Extjs4 tabpanel,禁用所有子项而不循环它们

jee*_*iya 3 tabs extjs tabpanel extjs4

是否有任何方法可以禁用Extjs4选项卡面板上的所有子项,而无需循环它们.

我的代码:

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
    })
            ]
});
Run Code Online (Sandbox Code Playgroud)

我需要禁用myPanel的所有子项,但仍需要'myPanel'保持状态为启用.

Aci*_*ier 6

myPanel.items.each(function(c){c.disable();})
Run Code Online (Sandbox Code Playgroud)

然后

myPanel.items.each(function(c){c.enable();})
Run Code Online (Sandbox Code Playgroud)

把他们重新开火.

循环,但它没有使用"for循环",因为我认为问题是要陈述的.

  • 等什么?如何迭代不循环?:)这里真正的答案是没有没有disableAll功能,但显然你可以写一个像Geronimo所示. (3认同)