【问题标题】:Toolbar in extjs4extjs4 中的工具栏
【发布时间】:2012-10-05 03:30:40
【问题描述】:

我的 exts 4 窗口中有一些工具栏

this.tbar = {
            xtype: 'toolbar',
            items: [

                {
                    id: "btnClearFilter",
                    itemId: "btnClearFilter",
                    action: 'delFilter',
                    disabled: true,
                    handler: function (btn, e) {
                        btn.setDisabled(true);
                    }
                },
                '-',
                {
                    text: 'Export',
                    tooltip: 'Export',
                    disabled: false,
                    menu : {
                        items: [{
                            text: 'Export 1'
                            , icon: 'Content/Resources/images/Excel-16.png'
                            , action: 'export'
                        }]
                    }
                }
            ]
        };

从控制器我可以像这样触发 delFilter 操作

'ns-main-win > toolbar button[action=delFilter]': {
                click: this.delFilter
            },

菜单项如何操作?

【问题讨论】:

  • 你能详细说明你的问题吗....

标签: javascript extjs extjs4


【解决方案1】:

您是否尝试过给菜单项一个 id,然后使用它进行搜索

    '#export'{
        click:this.export 
        }

【讨论】:

    【解决方案2】:

    我不明白你的意思,你想在 delFilter 上触发动作吗?

    Ext.getCmp('btnClearFilter').click()
    

    【讨论】:

    • 我想在控制器'ns-main-win > 工具栏菜单 > menuitem > button[action=export]' 中使用类似的东西:{ click: this.export },
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多