PDA

View Full Version : Checkbox and Combo throw TypeError



groovydude
6 Jan 2012, 4:15 PM
I have a form.Panel in which if I insert a checkbox , checkbox group, or combobox (local or remote), the whole thing crashes with a 'TypeError' (Chrome devtools) . For example, when I insert a checkbox in the items array for the form.Panel, the dev tools highlight line 247 in Checkbox.js :

me.addChildEls('boxLabelEl');

When I insert a ComboBox, another TypeError is thrown, highlighting another line in another file of ExtJS. I'm using 4.0.7 and if I use other field types everything works fine. Any ideas are greatly appreciated.

mitchellsimoens
7 Jan 2012, 6:17 AM
I'm not seeing any errors:


Ext.create('Ext.form.Panel', {
renderTo : Ext.getBody(),
width : 400,
height : 400,
dockedItems : [
{
xtype : 'toolbar',
dock : 'top',
items : [
{
text : 'Add Checkbox',
handler : function(btn) {
var form = btn.up('form');

form.add({
xtype : 'checkboxfield',
boxLabel : 'Checkbox'
});
}
},
{
text : 'Add CheckboxGroup',
handler : function(btn) {
var form = btn.up('form');

form.add({
xtype : 'checkboxgroup',
columns : 2,
items : [
{
boxLabel : 'Yes'
},
{
boxLabel : 'No'
}
]
});
}
}
]
}
]
});

groovydude
7 Jan 2012, 8:15 PM
Check this out: In my view, I was extending form.Panel . I changed that to panel.Panel and then moved the form to that panel's items array and now checkboxes and combos are working. Still not sure why, but it's working now.

Thanks for the help!