4

我有一个带有一些按钮的工具栏,其中一个按钮需要在创建时不可见,并且在我的应用程序中的某个位置可见。

我目前正在添加需要可见的按钮,但这并不是我想要的。

4

2 回答 2

8

创建按钮时,您可以hidden: true在配置中进行设置。

或者,您可以在添加按钮后立即“隐藏()”按钮,然后稍后再“显示()”按钮。

于 2013-01-22T10:39:33.257 回答
1
find the button and make it invisible

Ext.create('Ext.toolbar.Toolbar', {
        renderTo: document.body,
        width   : 400,
        items: [
            {
                text: 'Button',
                id: 'my-btn',
                hidden: true
            },
            {
                xtype: 'splitbutton',
                text : 'Split Button'
            },
            '->',
            {
                xtype    : 'textfield',
                name     : 'field1',
                emptyText: 'enter search term'
            }
        ]
    });
于 2013-01-23T08:33:01.873 回答