PDA

View Full Version : Get Error 'Uncaught TypeError: object is not a function' on creating Radio instances



akash_fil
3 Oct 2012, 3:26 AM
Getting Error 'Uncaught TypeError: object is not a function' on creating Radio instances as below:

var radioBtn = Ext.create('Ext.form.Field.Radio',
{
xtype: 'radiofield',
boxLabel : aLabel,
name: rbGroupName,
inputValue: value
}
);

SDK: EXT-JS 4.1.2

scottmartin
3 Oct 2012, 5:58 PM
Please check the API for proper usage:




Ext.create('Ext.form.Panel', {
title : 'Order Form',
width : 300,
bodyPadding: 10,
renderTo : Ext.getBody(),
items: [{
xtype: 'radiofield',
boxLabel : 'label'
//name: rbGroupName
//inputValue: value

}]
});



Scott.

akash_fil
3 Oct 2012, 9:25 PM
Please check the API for proper usage:




Ext.create('Ext.form.Panel', {
title : 'Order Form',
width : 300,
bodyPadding: 10,
renderTo : Ext.getBody(),
items: [{
xtype: 'radiofield',
boxLabel : 'label'
//name: rbGroupName
//inputValue: value

}]
});



Scott.

Thanks for the reply.

What I was trying to achieve is to have an RadioGroup with set of Radio Buttons. No. of Radio Buttons can vary in my present case. So I have to create them dynamically. I tried creating it with Ext.create which did not work. I expect this to work with Ext.create as it works for all the visuals components. If we consider no. of radio buttons to be created at run time for a button group, then definitely it should work with Ext.create. Specifying xtype for the radiofield in items of radio group works, but why not with Ext.create?

Can you please elaborate it as documentation doesn't say anything about the creation of Radio buttons at run time in a way I think should work?