Login Register

Grid not displaying data

Hi,
I am new to dojo and still learning it. I am facing a problem that I am sending a JSON response from the server and Iam trying to display that response data in the grid. Well I am getting the response back to the client but data is not vivible on the grid and the debug console shows no error. Can any one help mw ASAP as I need this very urgently.

Thanks in advance.

Hmm.... I'm starting a HUGE project this week and wonder if Dojo

can do it. Grid handling is very important to me... I won't be able to wait a week like newtoAJAX has waited so far with no suggestions... :(

Same problem

nevermind!

how about some code... so we

how about some code... so we can start to help.

try defining a height and width - you might not see the grid if you don't give it a height and width. if you are declaring your grid in html (decalratively), you can add this property.

style="width:50em; height:10em;"

another option is using css. if your grid id is declared as "grid" then this css will be applied to the item with that specific id:

#grid {
            border: 1px solid #333;
            height: 10em;
            width: 50em;
                }

try looking at the tests here http://archive.dojotoolkit.org/nightly/dojotoolkit/dojox/grid/tests/ and see if the code in those can help you.

also, if you need help, post to the support forums:
1. it's just the right thing to do.
2. it probably has a little more traffic and you'll probably get help the same day you post!

this thread should probably get moved over there

Data format for server responce

I had a similar problem, I was formating the data wrong in a json responce. It needs to be of this format: (using dojo nightly)

{identifier: 'Id', label: 'Id', items:[{"Id":1,"Email":"mail","Password":"password","Note":"?","Permissions":"admin"},{"Id":2,"Email":"ppppppp","Password":"password","Note":null,"Permissions":null}]}

ie, an object with three attributes, identifer (the name of the key column), label (I think a engish version of the key), and items (an array of objects, each object a row of data).

Hope that helps.

The data format depends on the used datastore

Hi smogit,

the necessary data format depends on the underlying datastore. The data format in your post is valid for the ItemFileReadStore, ItemFileWriteStore and perhaps other datastores (don't know them all).

With Dojo Toolkit V1.2 the Grid will change. The documentation for the Grid 1.2 is not finished, until now. But I'm sure, we will see some further explanations from the developers about the choosen redesign decisions within the next days.

Marcus
------------
http://www.dojotoolkit-forum.de