Reputation: 571
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 .
Upvotes: 3
Views: 4901
Reputation: 43
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 }'
}
Upvotes: 0
Reputation: 11486
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.
Upvotes: 6
Reputation: 15673
You can just set disabled:true on the initial config for each panel. Is that what you were asking?
Upvotes: 0