Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9176277
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T17:04:41+00:00 2026-06-17T17:04:41+00:00

In one of my projects I need to load the Json store with a

  • 0

In one of my projects I need to load the Json store with a JSOn server response as follows. In the JSon response i am getting 2-3 root elements. but in the store configuration i can only provide 1 root element.

{
    {"level2List":[{id:'id1', name:'sample'},....]},
    {"level3List":[{id:'id1', name:'sample'},....]},
    {"level4List":[{id:'id1', name:'sample'},....]}
}

my store config is like below.

store = new Ext.data.JsonStore({
// store configs
storeId: 'myStore',
proxy: {
    type: 'ajax',
    url: 'xml/getKpiInputData.json',
    reader: {
        type: 'json',
        root: 'level3List',
        idProperty: 'name'
    }
},
fields: [
        {name: 'name'},
        {name: 'id'},
       ...
    ],
remoteFilter: false,
remoteSort: true,
    pageSize: 10,
autoLoad: {start: 0, limit: 10}
 });

If i give the 1 root element(for ex. level3List) it is loading the respective items properly. But I need the solution to load data from multiple root elements. Please help me in loading the data to the store.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T17:04:42+00:00Added an answer on June 17, 2026 at 5:04 pm

    If you’re using 4.x, the root parameter can be a function:

    Ext.define('MyModel', {
        extend: 'Ext.data.Model',
        fields: ['name']
    });
    
    Ext.require('*');
    
    Ext.onReady(function(){
    
        var store = new Ext.data.Store({
            model: MyModel,
            proxy: {
                type: 'memory',
                reader: {
                    type: 'json',
                    root: function(o){
                        var out = [];
                        return out.concat(o.root1, o.root2, o.root3);
                    }
                }
            },
            data: {
                root1: [{
                    name: 'Item 1'
                }],
                root2: [{
                    name: 'Item 2'
                }],
                root3: [{
                    name: 'Item 3'
                }]
            }
        });
    
        store.load();
        console.log(store.getCount());
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

i need to have one project on asp.net mvc 1 but i want to
Actually in one of my project i need to read images from remote server
I need to build a solution, but exclude one project. How should I do
For a project I need to give a load of diverse data in JSON
I need to create a game for one of my projects. The game is
I need to read through the XML file that contains info but one at
I have a one page document that has several images which need to load
I use Zend Framework 1.12 on one of my projects. I need to use
One of my projects needs to load audio from audio library. It works on
In one of my projects I need to build an ASP.NET page and some

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.