简体   繁体   English

extjs 3.4 如何给toolbar动态添加checkbox

[英]extjs 3.4 how to dynamically add checkbox to toolbar

I have Panel with a BottomToolbar .我有一个带有BottomToolbar的面板。 I want to add and remove dynamically a checkbox/checkboxgroup or radio/radiogroup .我想动态添加和删除checkbox/checkboxgroupradio/radiogroup I saw that we have the method addItem for Ext.Toolbar but the checkbox doesn't extends Item... Is there a way to accomplish this?我看到我们有Ext.ToolbaraddItem ,但复选框没有扩展 Item ...有没有办法完成这个?

A preview of my code and what I want to achieve:我的代码预览和我想要实现的目标:

var myCheckboxGroup = new Ext.form.CheckboxGroup({
        id:'displayParamCheckGroup',
        xtype: 'checkboxgroup',
        columns: 1,
        items: checkboxArray
    });
Ext.getCmp('siteChartPanel').getBottomToolbar().add(myCheckboxGroup);

You have forgotten to call doLayout() method after adding:您忘记在添加后调用 doLayout() 方法:

Ext.getCmp('siteChartPanel').getBottomToolbar().doLayout();

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM