Vijay Marudhachalam
Vijay Marudhachalam

Reputation: 112

How to disable group of text field in cq5 dialog using script

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

Answers (1)

rakhi4110
rakhi4110

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

Related Questions