Reputation: 112
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
Upvotes: 0
Views: 398
Reputation: 9281
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);
});
Upvotes: 1