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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T23:51:57+00:00 2026-06-05T23:51:57+00:00

Given the following JSON data: [ { pk: 2, model: corkboard.announcement, fields: { body:

  • 0

Given the following JSON data:

[
{
    "pk": 2, 
    "model": "corkboard.announcement", 
    "fields": {
        "body": "Test announcement 2 body.", 
        "date": "2012-04-10T00:59:12Z", 
        "title": "Test Announcement 2"
    }
}, 
{
    "pk": 1, 
    "model": "corkboard.announcement", 
    "fields": {
        "body": "Test Announcement 1 body.", 
        "date": "2012-04-10T00:58:56Z", 
        "title": "Test Announcement 1"
    }
}
]

I’m creating a dojox/DataGrid but I can’t seem to find a way to access “fields” children.

Here is the javascript:

<script>
        var announcementStore, dataStore, grid;
        require(["dojo/store/JsonRest", "dojo/store/Memory", "dojo/store/Cache", "dojox/grid/DataGrid", "dojo/data/ObjectStore", "dojo/query", "dojo/domReady!"], 
            function(JsonRest, Memory, Cache, DataGrid, ObjectStore, query){
            announcementStore = Cache(JsonRest({target:"/corkboard/announcements/"}), Memory());
            grid = new DataGrid({
                store: dataStore = ObjectStore({objectStore: announcementStore}),
                structure: [
                    {name:"Title", field:"title", width: "200px"},
                    {name:"Body", field:"body", width: "200px", editable: true}
                ]
            }, "target-node-id");
            grid.startup();
            query("#save").onclick(function(){
                dataStore.save();
            });
        });
</script>

I tried using fields.title and fields.body when defining the field, but that didn’t work.

In this example, how would I access “fields” children?

  • 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-05T23:52:00+00:00Added an answer on June 5, 2026 at 11:52 pm

    You need to use the formatter method in the structure of the grid like below.

    {name:"Title",field:"_item",widht:"200px",formatter:function(item){return item.fields.title}}
    

    Remember, you need to passs _item in the field, which will give you entire row in the formatter method and using dot notation, you can return the reuqired data

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

Sidebar

Related Questions

Given the following array of json objects: var items = [ {id:1, parentId:0, name:'item1'},
// given following array: $data = array( 0=>array( data=>object1, col=>array( 0=>array( data=>object2, col=>array( 0=>array(
I have the following code which retrieves data with a JSON request: // Replace
I am using following code for other JSON data its working but here it
Having a string containing the following raw Json data (simplified for the sake of
The following json and jqgrid options give me no data in my grid. var
Given following array: var arr = [undefined, undefined, 2, 5, undefined, undefined]; I'd like
Given following Statment: String query = "Select * from T_spareParts where SparePartPK IN (?
Installing egit on indigo im given following options : I've just checked 'Eclipse Egit'
Given the following code: $(.force-selection).blur(function() { var value = $('matched-item').val(); //check if the input's

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.