How can I add if condition inside items in ExtJS?
i want to change it like this ->
if x=='save' then items should be nameLabel, descriptionLabel
if x=='edit' then items should be workLabel, descriptionLabel
items : [
nameLabel, descriptionLabel
]
You can try declaring the items array as follow :
Items = [ ( x=='save' ? ['nameLabel'] : [workLabel]), 'itemDescription'];