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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T19:08:11+00:00 2026-06-15T19:08:11+00:00

I am trying to create a Dojo dojox.grid.DataGrid programmatically. It is getting created but

  • 0

I am trying to create a Dojo dojox.grid.DataGrid programmatically. It is getting created but does not show the output, instead it shows an error with the message: “Sorry, an error occurred”

Here is the code:

    var info=[
        {
            "Propery":"key1","Value":"value1"},
        {
            "Property":"key2", "Value":"value2"},
        {
            "Property":"key3","Value":"value3"}
    ];

    var layout = [
        {
            name: "Property",
            field: 'Property',
            width: "180px"},
        {
            name: "Value", 
            field: 'Value',
            width: "180px"}
    ];    

    var myStore = new dojo.data.ItemFileReadStore({data:{items:info}}); 

    var grid = new dojox.grid.DataGrid({
            store: myStore,
            structure: layout
        },"myDiv");       

    grid.startup();

I don’t know where it is going wrong, please help me out.

  • 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-15T19:08:13+00:00Added an answer on June 15, 2026 at 7:08 pm

    Dude, this is like the third time I answer a question of yours. It strongly reminds me of the two before, but i’ll have a try anyway.

    Your example can’t work, because in your layout-variable, you refer to a field named ‘property’ which doesn’t exist in data.items (info).

    You also did’t get the concept of the json–array right. It schould represent like a bunch of object with a very similar structure. Assume you want to store some people, then you would have some keys like firstname, lastname, age, gender etc. Each person would have different values on this. The json–array would look like that:

        var people = [
            {
                firstname: 'maja',
                lastname: 'van hinten'
                age: 23
                gender: 'w'},
            {
                firstname: 'willy',
                lastname: 'wantstoknowit'
                age: 11
                gender: 'm'},
            {
                firstname: 'helmut',
                lastname: 'kohl'
                age: 101
                gender: 'm'},
            ];
    

    Note, that the names of the properties are similar, just the values differ.

    What you try to do obviously is, to store one single object as an array, and make each property an object. Think about it: [] means array, {} means object in JavaScript.

    In fact, your info-variable should look like this:

        var info = [
            {
                "key1": "value1",       
                "key2": "value2",       
                "key3": "value3"}
        ];
    

    and if you would like to store some more object it would look like this:

        var info = [
            {
                "key1": "value1",       
                "key2": "value2",       
                "key3": "value3"},
            {
                "key1": "value4",       
                "key2": "value5",       
                "key3": "value6"},
            {
                "key1": "value7",       
                "key2": "value8",       
                "key3": "value9"}
        ];
    

    … objects stored in an array. Simple as that.

    Now to your layout var:

    It should discribe the structure of your DataGrid in relation to the data given by its store. So it descripes the columns as a whole, not the single cells.
    You can therefore only refer to the property-names (key1, key2, key3, or firstname, lastname, age, gender) but not to the values, as the may be different sometimes. You only know the structure of your objects, not its actual content.

    Therefore, it should look like that:

       var layout = [
            {
                name: "Key1's content", // you can name this whatever you want
                field: 'key1',          // but not this, it refers to the property name of your objects
                width: "180px"},
            {
                name: "Key2's content", // this could be named randomly too of course
                field: "key2",
                width: "180px"},
           {
                name: "Key3's content", // and that one as well
                field: "key3",
                width: "180px"}
        ];   
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to create a DOJO DataGrid populated using a dojo.data.ItemFileReadStore with very simple
I am trying to create an Enhanced Grid with nested sorting functionality in Dojo
Trying to create a black line in my view to separate text blocks but
Trying to create a new Dedicated Cache Role in Windows Azure but get the
Trying to create Database as follows: USE Master GO IF NOT EXISTS(SELECT [Name] FROM
Trying to create a background-image slideshow and am getting this error... This is the
I am trying to filter data in the dojo grid widget, however, I am
I'm trying to use Dojo dnd Source(1.4.2) to create an interface where I can
I'm trying to create a custom Dojo widget for my application. <!-- Dojo widget
I am trying to use the StoreSeries with Dojo in order to create charts.

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.