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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T04:49:07+00:00 2026-06-12T04:49:07+00:00

stackoverflow team member I am having problem with displaying the json subarray data to

  • 0

stackoverflow team member I am having problem with displaying the json subarray data to my gridpanel my json data is below

{
    "total": 11,
    "success": true,
    "employeetaskdetdata": [{
        "subject": "Work in progress",
        "employee": {
            "username": "yogen",
            "designation": {
                "department": {
                    "company": {
                        "cmpname": "Kintu Designs Pvt ltd",
                        "cmptitle": "Kintu Designs Pvt ltd",
                        "cmpdesc": "<b>D-104 Toral Appartment Surat,<br>Timalyabad.</b>",
                        "cmpfax": "8128812153",
                        "cmpcontact": "8128812153",
                        "cmpwebsite": "www.kintudesigns.com",
                        "cmpemail1": "yaryan997@gmail.com",
                        "cmpemail2": "yaryan997@gmail.com",
                        "cmpcountry": "India",
                        "cmpstate": "Gujarat",
                        "cmpcity": "Surat",
                        "cmpaddress": "D-104 Toral Appartment Surat,\nTimalyabad.",
                        "cmplogo": "calendar.png",
                        "cmplogopath": "upload/images/",
                        "cmpcreatedby": 1,
                        "cmpcreatedon": 1335764510000,
                        "cmpmodifiedon": 1335764510000,
                        "cmpmodifiedby": 0,
                        "id": 1
                    },
                    "departname": "Programmer",
                    "createdby": 1,
                    "createdon": 1335764655000,
                    "modifiedby": 1,
                    "modifiedon": 1335764655000,
                    "departdescr": "<b>?Programmer</b>",
                    "id": 2
                },
                "createdby": 1,
                "createdon": 1335764825000,
                "modifiedby": 1,
                "modifiedon": 1335764825000,
                "designame": "Senior JAVA Programmer",
                "desigdescr": "<b>?Senior JAVA Programmer</b>",
                "id": 6
            },
            "createdby": 1,
            "createdon": 1335765074000,
            "modifiedby": 1,
            "modifiedon": 1335765074000,
            "dateofbirth": 1335810600000,
            "joindate": 1337106600000,
            "firstname": "Yogendra",
            "surname": "Singh",
            "gender": "M",
            "marital": "U",
            "nationality": "",
            "contactno": "",
            "mobileno": "",
            "email": "",
            "otheremail": "",
            "fathername": "",
            "mothername": "",
            "accountno": "",
            "salary": "",
            "bank": {
                "bankname": "ICICI Bank",
                "bankaddress": "ICICI Bank Nanpura",
                "id": 1
            },
            "address": "",
            "id": 6,
            "password": "123"
        },
        "todaysdate": "2012-05-05",
        "createdby": 6,
        "createdon": 1336203851000,
        "modifiedby": 6,
        "modifiedon": 1336203851000,
        "project": {
            "company": {
                "cmpname": "Kintu Designs Pvt ltd",
                "cmptitle": "Kintu Designs Pvt ltd",
                "cmpdesc": "<b>D-104 Toral Appartment Surat,<br>Timalyabad.</b>",
                "cmpfax": "8128812153",
                "cmpcontact": "8128812153",
                "cmpwebsite": "www.kintudesigns.com",
                "cmpemail1": "yaryan997@gmail.com",
                "cmpemail2": "yaryan997@gmail.com",
                "cmpcountry": "India",
                "cmpstate": "Gujarat",
                "cmpcity": "Surat",
                "cmpaddress": "D-104 Toral Appartment Surat,\nTimalyabad.",
                "cmplogo": "calendar.png",
                "cmplogopath": "upload/images/",
                "cmpcreatedby": 1,
                "cmpcreatedon": 1335764510000,
                "cmpmodifiedon": 1335764510000,
                "cmpmodifiedby": 0,
                "id": 1
            },
            "createdby": 1,
            "createdon": 1335765435000,
            "modifiedby": 1,
            "modifiedon": 1335765435000,
            "projectname": "Project I",
            "projecttitle": "Project I",
            "projectdesc": "<b>Kintu Design Pvt ltd new Project I</b>",
            "projectstart": 1335810600000,
            "projectend": 1336761000000,
            "id": 1
        },
        "task": {
            "duration": 4.0,
            "employee": [{
                "username": "hiren",
                "designation": {
                    "department": {
                        "company": {
                            "cmpname": "Kintu Designs Pvt ltd",
                            "cmptitle": "Kintu Designs Pvt ltd",
                            "cmpdesc": "<b>D-104 Toral Appartment Surat,<br>Timalyabad.</b>",
                            "cmpfax": "8128812153",
                            "cmpcontact": "8128812153",
                            "cmpwebsite": "www.kintudesigns.com",
                            "cmpemail1": "yaryan997@gmail.com",
                            "cmpemail2": "yaryan997@gmail.com",
                            "cmpcountry": "India",
                            "cmpstate": "Gujarat",
                            "cmpcity": "Surat",
                            "cmpaddress": "D-104 Toral Appartment Surat,\nTimalyabad.",
                            "cmplogo": "calendar.png",
                            "cmplogopath": "upload/images/",
                            "cmpcreatedby": 1,
                            "cmpcreatedon": 1335764510000,
                            "cmpmodifiedon": 1335764510000,
                            "cmpmodifiedby": 0,
                            "id": 1
                        },
                        "departname": "Programmer",
                        "createdby": 1,
                        "createdon": 1335764655000,
                        "modifiedby": 1,
                        "modifiedon": 1335764655000,
                        "departdescr": "<b>?Programmer</b>",
                        "id": 2
                    },
                    "createdby": 1,
                    "createdon": 1335764755000,
                    "modifiedby": 1,
                    "modifiedon": 1335764755000,
                    "designame": "Senior PHP Programmer",
                    "desigdescr": "<b>?Senior PHP Programmer</b>",
                    "id": 3
                },
                "createdby": 1,
                "createdon": 1335765018000,
                "modifiedby": 1,
                "modifiedon": 1335765018000,
                "dateofbirth": null,
                "joindate": null,
                "firstname": "Hiren",
                "surname": "Patel",
                "gender": "M",
                "marital": "U",
                "nationality": "",
                "contactno": "",
                "mobileno": "",
                "email": "",
                "otheremail": "",
                "fathername": "",
                "mothername": "",
                "accountno": "",
                "salary": "",
                "bank": {
                    "bankname": "ICICI Bank",
                    "bankaddress": "ICICI Bank Nanpura",
                    "id": 1
                },
                "address": "",
                "id": 4,
                "password": "123"
            }, {
                "username": "yogen",
                "designation": {
                    "department": {
                        "company": {
                            "cmpname": "Kintu Designs Pvt ltd",
                            "cmptitle": "Kintu Designs Pvt ltd",
                            "cmpdesc": "<b>D-104 Toral Appartment Surat,<br>Timalyabad.</b>",
                            "cmpfax": "8128812153",
                            "cmpcontact": "8128812153",
                            "cmpwebsite": "www.kintudesigns.com",
                            "cmpemail1": "yaryan997@gmail.com",
                            "cmpemail2": "yaryan997@gmail.com",
                            "cmpcountry": "India",
                            "cmpstate": "Gujarat",
                            "cmpcity": "Surat",
                            "cmpaddress": "D-104 Toral Appartment Surat,\nTimalyabad.",
                            "cmplogo": "calendar.png",
                            "cmplogopath": "upload/images/",
                            "cmpcreatedby": 1,
                            "cmpcreatedon": 1335764510000,
                            "cmpmodifiedon": 1335764510000,
                            "cmpmodifiedby": 0,
                            "id": 1
                        },
                        "departname": "Programmer",
                        "createdby": 1,
                        "createdon": 1335764655000,
                        "modifiedby": 1,
                        "modifiedon": 1335764655000,
                        "departdescr": "<b>?Programmer</b>",
                        "id": 2
                    },
                    "createdby": 1,
                    "createdon": 1335764825000,
                    "modifiedby": 1,
                    "modifiedon": 1335764825000,
                    "designame": "Senior JAVA Programmer",
                    "desigdescr": "<b>?Senior JAVA Programmer</b>",
                    "id": 6
                },
                "createdby": 1,
                "createdon": 1335765074000,
                "modifiedby": 1,
                "modifiedon": 1335765074000,
                "dateofbirth": 1335810600000,
                "joindate": 1337106600000,
                "firstname": "Yogendra",
                "surname": "Singh",
                "gender": "M",
                "marital": "U",
                "nationality": "",
                "contactno": "",
                "mobileno": "",
                "email": "",
                "otheremail": "",
                "fathername": "",
                "mothername": "",
                "accountno": "",
                "salary": "",
                "bank": {
                    "bankname": "ICICI Bank",
                    "bankaddress": "ICICI Bank Nanpura",
                    "id": 1
                },
                "address": "",
                "id": 6,
                "password": "123"
            }],
            "createdby": 1,
            "createdon": 1336460152000,
            "modifiedby": 1,
            "modifiedon": 1336460152000,
            "project": {
                "company": {
                    "cmpname": "Kintu Designs Pvt ltd",
                    "cmptitle": "Kintu Designs Pvt ltd",
                    "cmpdesc": "<b>D-104 Toral Appartment Surat,<br>Timalyabad.</b>",
                    "cmpfax": "8128812153",
                    "cmpcontact": "8128812153",
                    "cmpwebsite": "www.kintudesigns.com",
                    "cmpemail1": "yaryan997@gmail.com",
                    "cmpemail2": "yaryan997@gmail.com",
                    "cmpcountry": "India",
                    "cmpstate": "Gujarat",
                    "cmpcity": "Surat",
                    "cmpaddress": "D-104 Toral Appartment Surat,\nTimalyabad.",
                    "cmplogo": "calendar.png",
                    "cmplogopath": "upload/images/",
                    "cmpcreatedby": 1,
                    "cmpcreatedon": 1335764510000,
                    "cmpmodifiedon": 1335764510000,
                    "cmpmodifiedby": 0,
                    "id": 1
                },
                "createdby": 1,
                "createdon": 1335765435000,
                "modifiedby": 1,
                "modifiedon": 1335765435000,
                "projectname": "Project I",
                "projecttitle": "Project I",
                "projectdesc": "<b>Kintu Design Pvt ltd new Project I</b>",
                "projectstart": 1335810600000,
                "projectend": 1336761000000,
                "id": 1
            },
            "percentdone": 55,
            "durationunit": "d",
            "startdate": 1336415400000,
            "parentid": 2,
            "taskindex": 0,
            "taskname": "Sub Task 2 1",
            "enddate": 1336761000000,
            "priority": 2,
            "id": 3,
            "depth": 2
        },
        "percentdone": 20,
        "totalworkedhrs": -9.5,
        "starttime": "09:00:00",
        "finishtime": "00:00:00",
        "id": 1,
        "description": "<b>Work in progress</b>",
        "hours": 0,
        "minutes": 30
    }, {
        "subject": "Work in progresss",
        "employee": {
            "username": "yogen",
            "designation": {
                "department": {
                    "company": {
                        "cmpname": "Kintu Designs Pvt ltd",
                        "cmptitle": "Kintu Designs Pvt ltd",
                        "cmpdesc": "<b>D-104 Toral Appartment Surat,<br>Timalyabad.</b>",
                        "cmpfax": "8128812153",
                        "cmpcontact": "8128812153",
                        "cmpwebsite": "www.kintudesigns.com",
                        "cmpemail1": "yaryan997@gmail.com",
                        "cmpemail2": "yaryan997@gmail.com",
                        "cmpcountry": "India",
                        "cmpstate": "Gujarat",
                        "cmpcity": "Surat",
                        "cmpaddress": "D-104 Toral Appartment Surat,\nTimalyabad.",
                        "cmplogo": "calendar.png",
                        "cmplogopath": "upload/images/",
                        "cmpcreatedby": 1,
                        "cmpcreatedon": 1335764510000,
                        "cmpmodifiedon": 1335764510000,
                        "cmpmodifiedby": 0,
                        "id": 1
                    },
                    "departname": "Programmer",
                    "createdby": 1,
                    "createdon": 1335764655000,
                    "modifiedby": 1,
                    "modifiedon": 1335764655000,
                    "departdescr": "<b>?Programmer</b>",
                    "id": 2
                },
                "createdby": 1,
                "createdon": 1335764825000,
                "modifiedby": 1,
                "modifiedon": 1335764825000,
                "designame": "Senior JAVA Programmer",
                "desigdescr": "<b>?Senior JAVA Programmer</b>",
                "id": 6
            },
            "createdby": 1,
            "createdon": 1335765074000,
            "modifiedby": 1,
            "modifiedon": 1335765074000,
            "dateofbirth": 1335810600000,
            "joindate": 1337106600000,
            "firstname": "Yogendra",
            "surname": "Singh",
            "gender": "M",
            "marital": "U",
            "nationality": "",
            "contactno": "",
            "mobileno": "",
            "email": "",
            "otheremail": "",
            "fathername": "",
            "mothername": "",
            "accountno": "",
            "salary": "",
            "bank": {
                "bankname": "ICICI Bank",
                "bankaddress": "ICICI Bank Nanpura",
                "id": 1
            },
            "address": "",
            "id": 6,
            "password": "123"
        },
        "todaysdate": "2012-05-05",
        "createdby": 6,
        "createdon": 1336204557000,
        "modifiedby": 6,
        "modifiedon": 1336204557000,
        "project": {
            "company": {
                "cmpname": "Kintu Designs Pvt ltd",
                "cmptitle": "Kintu Designs Pvt ltd",
                "cmpdesc": "<b>D-104 Toral Appartment Surat,<br>Timalyabad.</b>",
                "cmpfax": "8128812153",
                "cmpcontact": "8128812153",
                "cmpwebsite": "www.kintudesigns.com",
                "cmpemail1": "yaryan997@gmail.com",
                "cmpemail2": "yaryan997@gmail.com",
                "cmpcountry": "India",
                "cmpstate": "Gujarat",
                "cmpcity": "Surat",
                "cmpaddress": "D-104 Toral Appartment Surat,\nTimalyabad.",
                "cmplogo": "calendar.png",
                "cmplogopath": "upload/images/",
                "cmpcreatedby": 1,
                "cmpcreatedon": 1335764510000,
                "cmpmodifiedon": 1335764510000,
                "cmpmodifiedby": 0,
                "id": 1
            },
            "createdby": 1,
            "createdon": 1335765435000,
            "modifiedby": 1,
            "modifiedon": 1335765435000,
            "projectname": "Project I",
            "projecttitle": "Project I",
            "projectdesc": "<b>Kintu Design Pvt ltd new Project I</b>",
            "projectstart": 1335810600000,
            "projectend": 1336761000000,
            "id": 1
        },
        "task": {
            "duration": 4.0,
            "employee": [{
                "username": "hiren",
                "designation": {
                    "department": {
                        "company": {
                            "cmpname": "Kintu Designs Pvt ltd",
                            "cmptitle": "Kintu Designs Pvt ltd",
                            "cmpdesc": "<b>D-104 Toral Appartment Surat,<br>Timalyabad.</b>",
                            "cmpfax": "8128812153",
                            "cmpcontact": "8128812153",
                            "cmpwebsite": "www.kintudesigns.com",
                            "cmpemail1": "yaryan997@gmail.com",
                            "cmpemail2": "yaryan997@gmail.com",
                            "cmpcountry": "India",
                            "cmpstate": "Gujarat",
                            "cmpcity": "Surat",
                            "cmpaddress": "D-104 Toral Appartment Surat,\nTimalyabad.",
                            "cmplogo": "calendar.png",
                            "cmplogopath": "upload/images/",
                            "cmpcreatedby": 1,
                            "cmpcreatedon": 1335764510000,
                            "cmpmodifiedon": 1335764510000,
                            "cmpmodifiedby": 0,
                            "id": 1
                        },
                        "departname": "Programmer",
                        "createdby": 1,
                        "createdon": 1335764655000,
                        "modifiedby": 1,
                        "modifiedon": 1335764655000,
                        "departdescr": "<b>?Programmer</b>",
                        "id": 2
                    },
                    "createdby": 1,
                    "createdon": 1335764755000,
                    "modifiedby": 1,
                    "modifiedon": 1335764755000,
                    "designame": "Senior PHP Programmer",
                    "desigdescr": "<b>?Senior PHP Programmer</b>",
                    "id": 3
                },
                "createdby": 1,
                "createdon": 1335765018000,
                "modifiedby": 1,
                "modifiedon": 1335765018000,
                "dateofbirth": null,
                "joindate": null,
                "firstname": "Hiren",
                "surname": "Patel",
                "gender": "M",
                "marital": "U",
                "nationality": "",
                "contactno": "",
                "mobileno": "",
                "email": "",
                "otheremail": "",
                "fathername": "",
                "mothername": "",
                "accountno": "",
                "salary": "",
                "bank": {
                    "bankname": "ICICI Bank",
                    "bankaddress": "ICICI Bank Nanpura",
                    "id": 1
                },
                "address": "",
                "id": 4,
                "password": "123"
            }]
}

and my model is below

Ext.define('DEV.model.employeetaskdetModel', {
    extend: 'Ext.data.Model',
    fields : [
              { name: 'id'},
              { name: 'taskname', mapping:'task.taskname'},
              { name: 'firstname', mapping: 'employee.firstname'},
              { name: 'employee',type: 'auto'},
              { name: 'percentdone'}
          ]
});

and my grid panel columns are below

columns: [ {
     xtype: 'gridcolumn',
     dataIndex: 'percentdone',
     text: 'Percent Done'
 }, {
     xtype: 'gridcolumn',
     dataIndex: 'firstname',
     text: 'First Name'
 }]

I am not able to show the firstname in my gridPanel. But when I change the firstname column with below code it shows me the firstname gridpanel correctly.

{
         xtype: 'gridcolumn',
         dataIndex: 'employee',
         text: 'User Name',
         renderer: function (employee) {
             var result = [];
             employee = employee || [];
             var value = employee.firstname;
             if (value) {
                 result.push(value);
             }
             return result;
             console.log(employee.firstname);
         }
     },

please suggest me why my gridpanel didn’t show the firstname of user directly. What’s the problem with my code. And why its showing the data when I add the renderer 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-12T04:49:09+00:00Added an answer on June 12, 2026 at 4:49 am

    I encountered a similar problem and solve it.

    Mapping property is not required for mapping nested json data.

    Model:

    Ext.define("Model", {
        extend: "Ext.data.Model",
        fields: [
            {name: "id", type: "int"},
            {name: "name.name"},
            {name: "phone", mapping: "name.phone"},
            {name: "descr", type: "string", mapping:'description'}
        ]
    });
    

    Store with data that we will recieve from jsfiddle test echo ajax service:

    var Store = Ext.create("Ext.data.Store", {
        model: "Model",
        autoLoad: true,
        proxy: {
            type: 'ajax',
            url: '/echo/json/',
            //
            actionMethods: {read: 'POST'}, // echo ajax service required
            extraParams: {
                json: Ext.JSON.encode({
                    root: [
                        {id: 1, name: {name:"John", phone: "123"}, description:"Fapfapfap"},
                        {id: 2, name: {name:"Danny", phone: "234"}, description:"Boobooboo"},
                        {id: 3, name: {name:"Tom", phone: "345"}, description:"Tralala"},
                        {id: 4, name: {name:"Jane", phone: "456"}, description:"Ololo"},
                    ]
                    })
            },
            reader: {
                type: 'json',
                root: 'root'
            }
        },
    });
    

    Grid:

    Ext.create("Ext.grid.Panel", {
        store: Store,
        columns: [
            {dataIndex: "id", header:"ID"},
            {dataIndex: "name.name", header:"Name", flex: 1, editor: "textfield"},
            {dataIndex: "phone", header:"Phone", flex: 1, editor: "textfield"},
            {dataIndex: "descr", header: "Description", flex: 2, editor: "htmleditor"}
        ],
        renderTo: Ext.getBody(),
    });
    

    This should work, if other problems is absent.

    Here you can see work example http://jsfiddle.net/Fgh7z/1/

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

Sidebar

Related Questions

stackoverflow forum member I am having some problem with a certain report designed using
Hi stackoverflow team i have a problem in converting base64 string to bitmap in
hi.. stackoverflow team member. I am trying to use the HttpSession in java to
First, thanks for the StackOverflow team, cause it's a very useful website, since i'm
Hello stackoverflow people! I've got a problem which I haven't been able to solve
I am aware of this question: https://stackoverflow.com/questions/428691/how-to-encourage-implementation-of-tdd In my team, we write a lot
Many applications (like StackOverflow) has been written by three developers (a small team), would
Hi StackOverflow team ! I've created an Eclipse RCP desktop application which has an
Today, a fellow team member checked-in some code that looked like this var query
Stackoverflow: For a cs assigment I am using the following code to stream audio.

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.