PDA

View Full Version : How to create record ?



extjs.mscit
15 Oct 2013, 1:12 AM
I want to create record from data provided.

In Extjs 3.4, I did as below.
var record = new Ext.data.Record({
"ID": 0,
"DESC": response.desc,
"WIZARD": response.wizardtype
});

How to do the same in Extjs 4.1??

Thanks

HTK
15 Oct 2013, 1:32 AM
First define your model via Ext.define, then create an instance of your model with Ext.create.
Check this link.
http://docs.sencha.com/extjs/4.2.2/#!/api/Ext.data.Model

existdissolve
15 Oct 2013, 4:08 AM
In Ext JS 4, the "record" is now Ext.data.Model: http://docs.sencha.com/extjs/4.1.0/#!/api/Ext.data.Model

The documentation includes an example of what you want to do.