I have group of text field in a cq dialog. i want disable without using for loop in js. Is it possible to disable findByType("textfield").disable like this code so that all the text field in that dialog will be disabled
1 Answers
1
votes
I don't think you can achieve it in a single statement. However, you can use the CQ.Ext.each to loop over the collection of textfield and then disable them.
Assuming you have the handle of the parent container such as dialog / panel (in this case a dialog), the code would be as follows.
CQ.Ext.each(dialog.findByType("textfield"), function() {
this.setDisabled(true);
});
CQ.Ext.each(findByType("textfield"), function() { this.setDisabled(true); });- rakhi4110