Search code examples
extjstabsextjs4tabpanel

Extjs4 tabpanel, disable all child item without looping them


is there are any way to disable all child items on Extjs4 tab panel, without looping them.

my code:

var myPanel = new Ext.TabPanel({
    region: 'east',
    title: 'my panel title',
    width: 200,
    id: 'my-panel',
    split: true,
    collapsible: true,
    collapsed: true,
    floatable: true,
    xtype: 'tabpanel',
    items: [
        Ext.create('Ext.panel.Panel', {
        id: 'my-detail-panel',
        title: 'My Info',
        autoScroll: true,
        file: false,
        type: 'vbox',
        align: 'stretch',
        tpl: myDetailsTpl
    }),
        Ext.create('Ext.panel.Panel', {
        id: 'my-more-detail-panel',
        title: 'My more info',
        autoScroll: true,
        file: false,
        type: 'vbox',
        align: 'stretch',
        tpl: myMoreDetailsTpl
    })
            ]
});

i need disable myPanel's all child items, but still need to 'myPanel' keep status as enable .


Solution

  • myPanel.items.each(function(c){c.disable();})
    

    then

    myPanel.items.each(function(c){c.enable();})
    

    to fire them back up again.

    This is looping, but it is not using a "for loop" as I think the question was meant to state.