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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T02:05:02+00:00 2026-06-15T02:05:02+00:00

Here is my Sencha Touch 2 code which shows the JSON list data in

  • 0

Here is my Sencha Touch 2 code which shows the JSON list data in the Ext.data.List component. I have used tpl for creating listed items. Now i am in the need of conveting this List to Nested List. But failed and i have no idea how can i move the list view’s itemTpl to Nest List’s getItemTextTpl?

Code with List

    Ext.define('Mobile.view.ActionListView', {
        extend: 'Ext.dataview.List',
        xtype: 'actionsummary',
        id: 'actionsummaryList',

        config: {
            title: 'Actions',

            store: 'ActionSummaryStore',
            //data:[{"Id":1,"TransactionType":"Transaction 1","ActionList":[{"Id":1,"Count":4,"Action":"Action Item 1","CurrentStatus":"Open"},{"Id":2,"Count":14,"Action":"Action Item 3","CurrentStatus":"Open"},{"Id":3,"Count":44,"Action":"Action Item 5","CurrentStatus":"Close"}]}],
            emptyText: 'Loading action items...',
            itemTpl: Ext.create('Ext.XTemplate', '<tpl for=".">',
                                                    '<div class="action-item-container"><p class="action-text">{TransactionType}</p>',
                                                          '<tpl for="ActionList"><tpl for=".">',
                                                                '<div><ul>',
                                                                   '<li><a href="javascript:void(0)"><span class="action-count">{CurrentStatus}<tt>({Count})</tt></span><span class="btn-{Action}">{Action}</span></a></li>',                                                               

                                                                 '</ul></div>',
                                                            '</tpl></tpl>',
                                                     '</div>',
                                                   '</tpl>'

                               )
        }
    });

New Code with Nested List

    Ext.define('Mobile.view.ActionListView', {
        extend: 'Ext.dataview.NestedList',
        xtype: 'actionsummary',
        id: 'actionsummaryList',

        config: {
            title: 'Actions',

            store: 'ActionSummaryStore',
            useTitleAsBackText: false,
            onItemDisclosure: true,

            //data:[{"Id":1,"TransactionType":"Transaction 1","ActionList":[{"Id":1,"Count":4,"Action":"Action Item 1","CurrentStatus":"Open"},{"Id":2,"Count":14,"Action":"Action Item 3","CurrentStatus":"Open"},{"Id":3,"Count":44,"Action":"Action Item 5","CurrentStatus":"Close"}]}],

            itemTpl: Ext.create('Ext.XTemplate', '<tpl for=".">',
                                                    '<div class="action-item-container"><p class="action-text">{TransactionType}</p>',
                                                          '<tpl for="ActionList"><tpl for=".">',
                                                                '<div><ul>',
                                                                   '<li><a href="javascript:void(0)"><span class="action-count">{CurrentStatus}<tt>({Count})</tt></span><span class="btn-{Action}">{Action}</span></a></li>',

                                                                 '</ul></div>',
                                                            '</tpl></tpl>',
                                                     '</div>',
                                                   '</tpl>'

                               )
        },

        getTitleTextTpl: function () {
            return 'Summary View';
        },
        getItemTextTpl: function (node) {
           // return '<div><strong>{name}:</strong> <em>{description}</em></div>';
           //replace this code with my above itemTPL
        }
    });
  • 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-15T02:05:03+00:00Added an answer on June 15, 2026 at 2:05 am

    With this kind of model, I wouldn’t use a NestedList but something like this

    Check this answer : Nested List, Multiple Layouts

    Ext.Loader.setConfig({
        enabled: true
    });
    
    Ext.application({
        name: 'SenchaFiddle',
    
        launch: function() {
    
            var navigationview = Ext.create('Ext.navigation.View', {
                fullscreen: true,
                autoDestroy: false
            });
    
            var data = {
                BranchID : 4,
                BranchName : "Branch Name",
                Jobs : [{
                    JobOrderID : 75,
                    JobTitle : "Job Title 75",
                    leaf : true
                },{
                    JobOrderID : 76,
                    JobTitle : "Job Title 76",
                    leaf : true
                }]
    
            };
    
            Ext.define('Job', {
                extend: 'Ext.data.Model',
                config: {
                    fields: ['JobOrderID', 'JobTitle']
                }
            });
    
            Ext.define('Branch', {
                extend: 'Ext.data.Model',
                config: {
                    fields: ['BranchID', 'BranchName']
                },
                hasMany: {associatedModel: 'Job', name: 'jobs'}
    
            });
    
            var branchstore = Ext.create('Ext.data.Store', {
                model: 'Branch',
                data: data
            });
    
            var jobstore = Ext.create('Ext.data.Store', {
                model: 'Job',
            });
    
            var jobdetails = Ext.create('Ext.Container',{
    
            });
    
            var joblist = Ext.create('Ext.List',{
                title:'Jobs',
                itemTpl: '{JobTitle}',
                store: jobstore,
                listeners: {
                    itemtap: function(l,i,t,r,e) {
                        jobdetails.setHtml(r.get('JobOrderID')+': '+r.get('JobTitle'));
                        navigationview.push(jobdetails);
                    }
                }
            });
    
            var branchlist = Ext.create('Ext.List',{
                title:'Branches',
                itemTpl: '{BranchName}',
                store: branchstore,
                listeners: {
                    itemtap: function(l,i,t,r,e) {
                        jobstore.setData(r.raw.Jobs);
                        navigationview.push(joblist);
                    }
                }
            });
    
            navigationview.push(branchlist);
        }
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a List generated from JSON data in Sencha Touch. Essentially, the list
Here, the Sencha team explains how to have a one to many relationship: http://docs.sencha.com/ext-js/4-0/#!/api/Ext.data.Store
I am attempting to add a List component to a view in Sencha Touch.
On a sencha-touch, here's is my store declaration Ext.regStore('newsStore', { model: 'News', autoLoad: true,
I'm developing a Sencha Touch application in which I'm doing lots of Ext.extend and
I'm creating a Sencha Touch application. I would like to have a banner docked
I have two questions regarding component layout using Sencha Touch 2: How can you
Here is my code: <script src=include/cordova.js type=text/javascript></script> <script src=include/sencha-touch-all.js type=text/javascript></script> <script type=text/javascript charset=utf-8 src=include/childbrowser.js></script>
I have implemented Tabbar in sencha touch without any content as follows: using code
I have a list of contacts that sencha touch is displaying in a list.

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.