-
19 Oct 2011 11:09 PM #1
How to retrieve record definition
How to retrieve record definition
Hi,
I have a grid that is loaded by metadata
i a classic way I have
var MyRecordType = Ext.data.Record.create(['col1', 'col2']);
var myrec = new MyrecordType({"col1":"101", "col2":"1234"});
grid.store.insert(i,myrec);
BUT, I don't want to hard code the record type on the client side
Does exist a way to retrieve them from the store and have the same result in myrec ?
Thanks for your helpTamditi Karim
-
21 Oct 2011 12:19 AM #2
[SOLVED] How to retrieve record definition
[SOLVED] How to retrieve record definition
Here is my solution.
and the json for rootDataDefaultValue is likePHP Code:oneRecordDef = Ext.data.Record.create(grid.store.reader.jsonData.metaData.fields);
oneRecordEmpty = new oneRecordDef(grid.store.reader.jsonData.rootDataDefaultValue[0]);
grid.store.insert(i,oneRecordEmpty);
PHP Code:"rootDataDefaultValue":[
{
"CIV_ID":"0 ",
"CIV_LANGUE":"'' ",
"CIV_ORDRE":"0",
"CIV_LIBELLE":"''",
"CIV_ID_SEXE":"0",
"CIV_DELETED":"0"
}
],
Tamditi Karim


Reply With Quote