我正在尝试动态地将新表单组件添加到表单内的字段集中,而我正在努力使用复选框组件。
我在firebug上遇到“TypeError:Ext.form.Checkbox不是构造函数”错误。这是我的代码:
...
Ext.getCmp('component1').add(new Ext.form.DisplayField({value: "aValue"}));
Ext.getCmp('component1').doLayout();
Ext.getCmp('component2').add(new Ext.form.Checkbox({fieldlabel:"aLabel",
name: "aName"}));
Ext.getCmp('component2').doLayout();
...
两个组件(component1,component“)都是xtype:fieldset
,看起来完全一样。
第一个组件DysplayField
正常工作,但复选框没有。
答案 0 :(得分:1)
您可能需要检查component2的布局。或者比较component1和component2之间的布局。尝试将布局设置为相同。