1. #1
    Sencha User tdikarim's Avatar
    Join Date
    Jun 2007
    Location
    Belgium - Brussel
    Posts
    142
    Vote Rating
    0
    tdikarim is an unknown quantity at this point

      0  

    Default 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 help
    Tamditi Karim

  2. #2
    Sencha User tdikarim's Avatar
    Join Date
    Jun 2007
    Location
    Belgium - Brussel
    Posts
    142
    Vote Rating
    0
    tdikarim is an unknown quantity at this point

      0  

    Default [SOLVED] How to retrieve record definition

    [SOLVED] How to retrieve record definition


    Here is my solution.

    PHP 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); 
    and the json for rootDataDefaultValue is like
    PHP Code:
       "rootDataDefaultValue":[
          {
             
    "CIV_ID":"0 ",
             
    "CIV_LANGUE":"'' ",
             
    "CIV_ORDRE":"0",
             
    "CIV_LIBELLE":"''",
             
    "CIV_ID_SEXE":"0",
             
    "CIV_DELETED":"0"
          
    }
       ], 
    Tamditi Karim

film izle

hd film izle

film sitesi

takipci kazanma sitesi

takipci kazanma sitesi

güzel olan herşey

takipci alma sitesi

komik eğlenceli videolar