Sencha touch 与sencha touch工具栏相关的问题

Sencha touch 与sencha touch工具栏相关的问题,sencha-touch,Sencha Touch,我对sencha touch很陌生。我正在使用sencha开发一个应用程序。我在工具栏上添加了三个按钮。在这三个按钮中,当我单击一个按钮时,工具栏应该在按钮单击中动态添加两个以上的按钮。我的代码如下: this.profitChartToolbar = new Ext.Toolbar({ ui:'max', items: [this.qButton,this.hButton,this.yButton] }); 通过这种方式,我在工具栏上

我对sencha touch很陌生。我正在使用sencha开发一个应用程序。我在工具栏上添加了三个按钮。在这三个按钮中,当我单击一个按钮时,工具栏应该在按钮单击中动态添加两个以上的按钮。我的代码如下:

this.profitChartToolbar = new Ext.Toolbar({         
        ui:'max',
        items: [this.qButton,this.hButton,this.yButton]
    });
通过这种方式,我在工具栏上添加了三个按钮。现在,当点击任何一个按钮时,我想在这三个按钮的同时再添加两个按钮。任何人都可以尽快共享此解决方案

提前感谢。

有趣的任务:)

var fnCreateTwoButtons=function(){
对于(变量i=0;i<2;i++){
this.profitChartToolbar.add({
文本:“新建按钮”#“+i);
});
}
};
this.qButton.on('tap',fncreateTwobutions,this);
this.hButton.on('tap',fncreateTwobutions,this);
this.yButton.on('tap',fnCreateTwoButtons,this);
未测试…

有趣的任务:)

var fnCreateTwoButtons=function(){
对于(变量i=0;i<2;i++){
this.profitChartToolbar.add({
文本:“新建按钮”#“+i);
});
}
};
this.qButton.on('tap',fncreateTwobutions,this);
this.hButton.on('tap',fncreateTwobutions,this);
this.yButton.on('tap',fnCreateTwoButtons,this);

未测试…

您可以使用
button.hide()

您可以通过函数
按钮添加自定义按钮。将
添加到现有工具栏

您可以使用
按钮隐藏以前的按钮。hide()
您可以通过功能
按钮添加自定义按钮。将
添加到现有工具栏

var fnCreateTwoButtons = function() {
    for (var i = 0; i < 2; i++) {
        this.profitChartToolbar.add({
            text: 'New Button #' + i);
        });
    }
};
this.qButton.on('tap', fnCreateTwoButtons, this);
this.hButton.on('tap', fnCreateTwoButtons, this);
this.yButton.on('tap', fnCreateTwoButtons, this);