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

  • Home
  • SEARCH
  • 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 6103587
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T13:44:44+00:00 2026-05-23T13:44:44+00:00

I have JSON Data in this format : var jsonData = [{date:’August 19, 2004′,open:100.01,high:104.06},{date:’August

  • 0

I have JSON Data in this format :

var jsonData = [{date:'August 19, 2004',open:100.01,high:104.06},{date:'August 19, 2004',open:100.01,high:104.06},{date:'August 19, 2004',open:100.01,high:104.06}];

How can i print this data inside my Dojox.grid.DataGrid

<body class=" claro ">
        <span dojoType="dojo.data.ItemFileReadStore" jsId="store1" url="data.json">
        </span>
        <table dojoType="dojox.grid.DataGrid" store="store1" 
       style="width: 100%; height: 100%;">
            <thead>
                <tr>
                    <th width="150px" >
                        Title of Movie
                    </th>
                    <th width="150px">
                        Year
                    </th>
                    <th width="150px" >
                        Producer
                    </th>
                </tr>

            </thead>
        </table>

    </body>
  • 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-05-23T13:44:45+00:00Added an answer on May 23, 2026 at 1:44 pm

    Remeber that ItemFileReadStore (all types of stores actually) need data in a specific format. You are telling me that you have a jsonData variable:

    var jsonData = [{date:'August 19, 2004',open:100.01,high:104.06},{date:'August 19, 2004',open:100.01,high:104.06},{date:'August 19, 2004',open:100.01,high:104.06}];
    

    This is not the format ItemFileReadStore wants. ItemFileReadStore wants an object with at least two properties: identifier and items. So change your data to:

    var jsonData = {identifier: "id", 
                    items: [
                      {id: 1, date:'August 19, 2004',open:100.01,high:104.06},
                      {id: 2, date:'August 19, 2004',open:100.01,high:104.06},
                      {id: 3, date:'August 19, 2004',open:100.01,high:104.06}
                    ]};
    

    As you can see, it’s now an object with the required properties. The identifier property tells the store to use a property named “id” to uniquely distinguish the items. Your objects didn’t have a unique property, so I added the id property on all items. You probably have some other property you can use.

    Next, since you have your data in a variable, why are you telling your ItemFileReadStore to get data from a URL called data.json? Instead, do:

    <span dojoType="dojo.data.ItemFileReadStore" jsId="store1" data="jsonData"></span>
    

    Lastly, your Grid itself. The table headers need to correspond to properties on the items in the store. You have, for example date, open and high, so use the field attribute on each th:

    <table dojoType="dojox.grid.DataGrid" store="store1" 
       style="width: 100%; height: 500px;">
        <thead>
            <tr>
                <th width="150px" field="date">Title of Movie</th>
                <th width="150px" field="open">Year</th>
                <th width="150px" field="high">Producer</th>
            </tr>
        </thead>
    </table>
    

    I added “height: 500px” to the table, but that may not be necessary for you.

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

Sidebar

Related Questions

The json needs to be in this format: var data = [ ['Heavy Industry',
I have a JSON data like this: { hello: { first:firstvalue, second:secondvalue }, hello2:
I have a web service that queries data from this json file, but I
I have an application which obtains data in JSON format from one of our
I have a requirement where i need to loop through JSON Format data and
I am recieving JSON data in this format:- { sEcho:1, total:1710, aaData:[ [ Help,
I everyone i have a JSON Array that is construct like this for (var
I use json data with jquery... I have filepaths in json and i am
I have a problem accessing JSON data. I'm new to JSON and jquery so
I have a controller that is called with AJAX (sends JSON data), so I

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.