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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T10:11:38+00:00 2026-06-12T10:11:38+00:00

I want to display nested JSON data in a dataview in my Sencha Touch

  • 0

I want to display nested JSON data in a dataview in my Sencha Touch 2 project. The JSON contains details of a servicerequest with progress.

The JSON:

{
    "success": true,
    "message": "Request retrieved with id:789",
    "data": {
        "id": 789,
        "description": "request description",
        "subject": "request subject",
        "progresses": [
            {
                "description": "progress description 1"
            },
            {
                "description": "progress description 2"
            },
            {
                "description": "progress description 3"
            }
        ]
    }
}

For getting the data, I have two models, one for the requestdetails, one for the progress and of course a store.

My store:

Ext.define('MyApp.store.RequestStore', {
    extend: 'Ext.data.Store',
    requires: [
        'MyApp.model.RequestModel'
    ],
    config: {
        autoLoad: true,
        autoSync: true,
        model: 'MyApp.model.RequestModel'
    }
});

And my models:

Ext.define('MyApp.model.RequestModel', {
    extend: 'Ext.data.Model',
    uses: [
        'MyApp.model.ProgressModel'
    ],
    config: {
        fields: [
            {
                name: 'id'
            },
            {
                name: 'description'
            },
            {
                name: 'subject'
            }
        ],
        hasMany: {
            associationKey: 'progresses',
            model: 'MyApp.model.ProgressModel'
        },
        proxy: {
            type: 'rest',
            url: 'http://myurl.com/rest/request/789',
            reader: {
                type: 'json',
                rootProperty: 'data'
            }
        }
    }
});

Ext.define('MyApp.model.ProgressModel', {
    extend: 'Ext.data.Model',
    uses: [
        'MyApp.model.RequestModel'
    ],
    config: {
        fields: [
            {
                name: 'description'
            }
        ],
        belongsTo: {
            model: 'MyApp.model.RequestModel'
        }
    }
});

This is my view:

Ext.define('MyApp.view.MyDataView', {
extend: 'Ext.dataview.DataView',

config: {
    store: 'RequestStoreId',
    itemTpl: [
        '<div>',
        '   <div>ID</div>',
        '   <div>{id}</div>',
        '           ',
        '   <div>Subject</div>',
        '   <div>{subject}</div>',
        '           ',
        '   <div>Description</div>',
        '   <div>{description}</div>',
        '</div>',
        '',
        '<h2><b>Progress:</b></h2>',
        '<tpl for="progressmodels">',
        '    <div>',
        '        <div>{description}</div>',
        '    </div>',
        '</tpl>'
    ]
}
});

Displaying the id, requestType, description and subject works fine. In case of the progress, I want all progressdescription to be shown, but only the first description is displayed now.

I tried a lot and search the internet to solve it, but I can’t figure out what it is.

What am I doing wrong here? Do I miss something? Are there people with the same problem?

Thanks in advance!

  • 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-12T10:11:39+00:00Added an answer on June 12, 2026 at 10:11 am

    Replacing

    <tpl for="progressmodels">

    with

    <tpl for="progresses">

    worked for me. The progresses node is the node I want to loop. Only disadvantage is that you can’t convert the data in the node with your model. You have to do this in your XTemplate as far as I know 🙂

    Hope this will help someone!

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

Sidebar

Related Questions

I want display data from database in Listbox...Here is my code, It is not
My issue is that I want to display data in a hierarchal structure as
I'm trying to select a nested table to display some tabular data using jQuery
I have a nested table arrangement for displaying data. I want the nested table
I want to display custom categories with their sub-categories in a nested list. This
Hi I want to display the data in the format that is represented in
i want display 1 record from colums zodys , I'm programint in C# I
I have a simple quiz application and I want display a nice timer /
I have db with this table (TableToDo): http://goo.gl/NlTEk I want display all records in
In the header of the django admin, I want display a link. This link

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.