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 8272185
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T07:03:22+00:00 2026-06-08T07:03:22+00:00

This topic has been discussed several times on the web but all subjects none

  • 0

This topic has been discussed several times on the web but all subjects none helped me solve my problem.
My javascript code receives the JSON nested data. All JSON data Level 1 data are transcribed in the grid panel but all child data none.
I have tried so many ways but impossible.
That’s why I’m asking you to help me please.

My JSON:

{
  "success":true,
  "error":false,
  "redirectUrl":null,
  "fund":[{
    "cat_id":1,
    "catname":"Europe OE Japan Large-Cap Equity",
    "region":{
      "region_id":2,
      "region_name":"JAPAN"
    }
    },{
    "cat_id":2,
    "catname":"Europe OE Europe Large-Cap Growth Equity",
    "region":{
      "region_id":1,
      "region_name":"EUROPE"
    }
   }]
} 

MY model:

var Recommended = new function() {

this.DataModel = function() {

Ext.define('Fund', {

    extend: 'Ext.data.Model',

    fields: [{
    name: 'catname',     
    type: 'string'
    },{
    name: 'cat_id',     
    type: 'int'     
    }],
    proxy :{
    type: 'rest',
    url: application +'directory/function',
    reader: {
        type: 'json',
        root: 'fund'

    }
    },
    associations: [{
    type: 'hasOne', 
    model: 'Region',
    primaryKey: 'region_id',
    name:'region'
    }]

});     

Ext.define('Region', {
    extend: 'Ext.data.Model',
    fields: [{
    name: 'region_name',       
    type: 'string'
    },{
    name: 'region_id',       
    type: 'int'     
    }]


});  

}

My Store & grid Panel:

    this.JSONstore = function() {

var storeRecommended;


storeRecommended = Ext.create('Ext.data.Store', {
    model: 'Fund',
    autoLoad:true,
    groupField: 'region_name'
});     




var colModel =
[
{
    text: 'REGION', 
    width: 200,
    dataIndex: 'region_name',
    name:'region_name',
    mapping:'region.region_name'

},{
    text: 'MORNINGSTAR', 
    width: 300,
    dataIndex: 'catname',
    name:'catname'  
}       


];

var groupingFeature = Ext.create('Ext.grid.feature.Grouping',{
    groupHeaderTpl: 'Classe: {name} ({rows.length} Item{[values.rows.length > 1 ? "s" : ""]})',
    hideGroupedHeader: false
});


var grid = Ext.create('Ext.grid.Panel', {
    renderTo: 'recommendedlists',
    collapsible: true,
    iconCls: 'icon-grid',
    frame: true,
    store: storeRecommended,
    width: 1200,
    height: 400,
    title: 'Test',
    resizable: true,
    features: [groupingFeature],
    columns: colModel,
    fbar  : ['->', {
    text:'Clear Grouping',
    iconCls: 'icon-clear-group',
    handler : function(){
        groupingFeature.disable();
    }
    }]
  });
   }

   this.initControlsOnload = function() {
   Recommended.DataModel();
   Recommended.JSONstore();
   }    
} // close Recommended function
  • 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-08T07:03:24+00:00Added an answer on June 8, 2026 at 7:03 am

    The problem is your store bound to the grid knows nothing about Regions. It stores Funds. So you can’t ask for a column to map to a data property that’s not in the store.
    The store is flat list of Fund records. And sure an individual Fund itself might know about the Region it belongs to, but the store containing a list of funds does not.

    What to do?

    What needs to happen is flattening out of your data structure on the client side. Why? Because the grid is flat. If you had multiple regions per fund – then we would be talking about a different solution.

    How to do that?

    If you control the server side of this app then add a Region field to the Fund object, then your data set is simple, straight forward and more importantly flat. If you can’t (or don’t want to) change the server side, then you can change the client side Model mapping. Essentially you would change your Fund model to something like this:

    Ext.define('Fund', {
        extend: 'Ext.data.Model',
        fields: [
          { name: 'catname',     type: 'string' },     
          { name: 'cat_id',      type: 'int' },
          { name: 'region_name', type: 'string',
              mapping: 'region.region_name'},
          { name: 'region_id',   type: 'int',
              mapping: 'region.region_id'}     
        ]
        ....
    });  
    

    You see what we did there? We flattened the Region data into the Fund record. And now your store will have no problems accessing Region name data by name.

    Good Luck,

    Dmitry.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I know this topic has been approached several times before in various ways, but
ok, I know that this topic has been addressed several times on here, but
This topic has been discussed million times before, but let me clarify my needs:
I know this topic has been addressed several times here, however my problem is
First of all, I know this topic has been brought up several times before
Though this topic has been discussed many times in this forum and all other
I know this topic has been discussed but I think it has some differences.
I know this topic has been discussed to death, but there is one thing
I know this topic has been asked, but the posts are all out of
I know this topic has been discussed before on Stack Overflow. But there are

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.