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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T16:08:43+00:00 2026-06-18T16:08:43+00:00

I’ve got a Json file…… [ { Title:Package1, id:1, POI:[ { Title:POI1, LayerID:1, },

  • 0

I’ve got a Json file……

 [
    {   
        "Title":"Package1", 
        "id":"1", 
        "POI":[
            {
                "Title":"POI1", 
                "LayerID":"1", 
            },  
            {
                "Title":"POI2", 
                "LayerID":"1", 
            }
},
 {   
        "Title":"Package2", 
        "id":"2", 
        "POI":[
            {
                "Title":"POI3", 
                "LayerID":"2", 
            },  
            {
                "Title":"POI4", 
                "LayerID":"2", 
            }
}
 ]

populating a store…..

 Ext.define('Murmuration.store.MyPackages', {
extend: 'Ext.data.Store',
xtype: 'myPackages',

config: {
    model: 'Murmuration.model.PackagesModel',
    proxy: {
        type: 'ajax',
        url : 'data/store.json',

    reader: {
        type: 'json'

    }
    },
    autoLoad: true

     }
 });

with a model……

 Ext.define('Murmuration.model.PackagesModel', {
extend: 'Ext.data.Model',
xtype: 'packagesModel',
config: {
    fields: [
    {name: 'Title', type: 'string'},
    {name: 'id', type: 'int'}
    ]
     }

 });

for said list……

 Ext.define('Murmuration.view.homeList', {
extend: 'Ext.List',
xtype: 'homeList',
fulscreen: true,
config: {
    title:'Murmuration',
    itemTpl: '<div>{Title}</div>',
    store:'MyPackages',
fulscreen: true,

     }
 });

The list Items are successfully being populated with ‘Package1’ and ‘Package2’. But for the life of me I can’t successfully change the code to populate the list with the POI titles for the fist package……..’POI1′ and ‘POI2’. How would I go about successfully implementing the following? Any help would be greatly appreciated.

  • 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-18T16:08:44+00:00Added an answer on June 18, 2026 at 4:08 pm

    The json you’ve given is nested so things little different here. First thing is, you need to specify a rootProperty in your reader. So you define a root element in your json and that element will be set to rootProperty.

    Next part is, you have POI as array of objects. So you’d need a separate model for POI.
    Model for POI can be defined –

    Ext.define('Murmuration.model.POIModel',{
        extend: 'Ext.data.Model',
        config: {
            fields: [
                {name: 'Title', type: 'string'},
                {name: 'LayerID', type: 'int'}
            ],
            belongsTo:'Murmuration.model.PackagesModel'
        }
    
    }); 
    

    After a close look, you’ll notice there’s one extra config belongsTo. This represents many to one association with your PackageModel since there are many POI in each package.

    After doing this, you’d need to change you PackageModel also to –

    Ext.define('Murmuration.model.PackagesModel', {
        extend: 'Ext.data.Model',
        config: {
            fields: [
              {name: 'Title', type: 'string'},
              {name: 'id', type: 'int'}
            ]
        },
        hasMany:{
            associationKey:'POI',
            model:'Murmuration.model.POIModel',
            name:'POI'
        }    
     });
    

    here, hasMany represents that this model is having multiple model instances of POI model. associationKey is the key POI from you json and model gives the model instance of POI model.

    After doing that you’d need to change your reader in store to –

    Ext.define('Murmuration.store.MyPackages', {
    extend: 'Ext.data.Store',       
    config: {
        model: 'Murmuration.model.PackagesModel',
        proxy: {
            type: 'ajax',
            url : 'data/store.json',
    
        reader: {
            type: 'json',
            rootProperty:'items'
        }
        },
        autoLoad: true
    
         }
     });
    

    rootProperty should be set to root of you json. I assumed it could be items here.

    Finally in you view you can have template set up like this –

    itemTpl: new Ext.XTemplate(['<div>Package Title => {Title}'+
                '<tpl for="POI"><h6>POI title => {Title}</h6><h6>POI layer => {LayerID}</h6></tpl></div>'
            ]),
    

    2 things I found in your code are not correct though –

    1. Store and Model can not have a xtype.
    2. All the config options should be inside config:{} only.
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am using JSon response to parse title,date content and thumbnail images and place
Let's say I'm outputting a post title and in our database, it's Hello Y&#8217;all
I have a .ini file as follows: [playlist] numberofentries=2 File1=http://87.230.82.17:80 Title1=(#1 - 365/1400) Example
I have just tried to save a simple *.rtf file with some websites and
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I am confused How to use looping for Json response Array in another Array.
I've got a string that has curly quotes in it. I'd like to replace
I want use html5's new tag to play a wav file (currently only supported
In my XML file chapters tag has more chapter tag.i need to display chapters
I am trying to render a haml file in a javascript response like so:

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.