I get data from server:
store = new dojox.data.QueryReadStore({"url":"http://url_with_data"});
...
myGrid = new dojox.grid.DataGrid({"id":"myGrid2","selectionMode":"none","style":"height: 350px; width: 100%;","store":store,"structure":myGrid2Layout}), document.createElement('div');
In this example server must return json object where exists property “items”, and this property contains all data. Example(php):
$a = array(
'items' => array(....)
);
echo json_encode($a);
The problem is that my server returns json with slightly different structure, like it:
$a = array(
'result' => array(
'items' => array(....)
);
);
echo json_encode($a);
How to solve this problem?
You can extend the QueryReadStore and override the _filterResponse function to manipulate the data you get back from the server.
See: http://trac.dojotoolkit.org/browser/dojo/tags/release-1.5.0/dojox/data/QueryReadStore.js and search for _filterResponse for some notes on this