1. #11
    Sencha User
    Join Date
    Mar 2011
    Posts
    3
    Vote Rating
    0
    kibriame is on a distinguished road

      0  

    Default


    I want to load one store with data from 3 roots. How can i read all roots data.
    here is the query result :
    ({
    "total":"13",
    "veh_cond_data":[{"veh_cond":"New","counter":"8"},{"veh_cond":"Recondition","counter":"3"},{"veh_cond":"Used","counter":"2"}],
    "color_data":[{"color":"red","counter":"5"},{"color":"silver","counter":"8"}],
    "data":[{"id":"206","user":null,"pro_name":"TOYOTA-COROLLA-X-2006_CB9162900368683040","veh_cond":"Used"},
    {"id":"198","user":null,"pro_name":"TOYOTA-ALLION--2011_CB9162900368683040","veh_cond":"New"}]
    })
    I have no problem to retirve data from data array and total, but i face problem in this two array,
    "veh_cond_data":[{"veh_cond":"New","counter":"8"},{"veh_cond":"Recondition","counter":"3"},{"veh_cond":"Used","counter":"2"}],
    "color_data":[{"color":"red","counter":"5"},{"silver":"8","counter":"3"}],

    How do I access data in "color_data" and "veh_cond_data" array in js file?
    Please give me some advice

  2. #12
    Sencha User
    Join Date
    Mar 2012
    Location
    hyderabad
    Posts
    6
    Vote Rating
    0
    sanjeevreddyk is on a distinguished road

      0  

    Default This will be possible if you are using EXT 4.x

    This will be possible if you are using EXT 4.x


    By using this proxy config you can read as many root elements as you want..


    reader: { type: 'json', root: function(o){ var out = []; return out.concat(o.root1, o.root2, o.root3); } }

  3. #13
    Sencha User
    Join Date
    Jul 2013
    Location
    Mysore, Karnataka, India
    Posts
    85
    Vote Rating
    6
    sanjayon19 is on a distinguished road

      0  

    Default Can we have a single JSON file and load the data to Multiple Components?

    Can we have a single JSON file and load the data to Multiple Components?


    Hi All,

    I'm developing a small app using ExtJS 4.2.1. I'm following MVC approach for loading data.
    Is it possible to have a single JSON file which is having some static data with different 'root' elements and can we load different components with that data?

    For Example, I have a comboBox and Grid. I want to have a single JSON file containing the data for both ComboBox and Grid?

    Can you please tell me how to do that? I tried giving 2 individual root elements, but the data is not getting loaded to both components.