ExtJs4 how to disable all fields and all buttons on a panel recursively

后端 未结 4 1535
无人共我
无人共我 2020-12-25 08:54

I\'m trying to disable all clickable, editable components on my panel.

Calling panel.disable() grays it out, but buttons are still clickable. The same r

4条回答
  •  我在风中等你
    2020-12-25 09:31

    Assuming that you used a FormPanel you can use this method to get form:

    getForm() // see http://docs.sencha.com/ext-js/4-0/#!/api/Ext.form.Panel-method-getForm
    

    This will return the Ext.form.Basic object. From here you have access to all the fields on this form with method:

    getFields() // see http://docs.sencha.com/ext-js/4-0/#!/api/Ext.form.Basic-method-getFields
    

    Now cou can iterate through the field and disable them. Notice also the method applyToFields() where you can pass your object. See API information: http://docs.sencha.com/ext-js/4-0/#!/api/Ext.form.Basic-method-applyToFields

    Good luck!

提交回复
热议问题