Question

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 .

Was it helpful?

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.

OTHER TIPS

You can just set disabled:true on the initial config for each panel. Is that what you were asking?

Try his:

// Create your own property for storing statu, 

config{
  allMyTabItemsEnabled = true;
}

// Then on all the items you want to disable/enable, add:

bind: {
  disabled: '{!allMyTabItemsEnabled }'
}

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top