smart rendering and json

Hello,



The JSON format for the grid and the XML format for the grid are not 1-to-1 so I’m having a hard time determining what the format is for JSON and passing the POS and TOTAL_COUNT values. In XML it looks like this:



<?xml version="1.0" encoding="UTF-8"?>





Hello World







In JSON I’m guessing its something like this:



$data={total_count:2000,pos:21,rows:[{id:12345,data:[‘Hello World’]}]};



Is that correct?

Yes, in case of JSON, XML attributes mapped to the properties.
Be sure to inlcude dhtmlxgrid_json.js file, without it - functionality will not work as expected.
If necessary , we can provide PHP based sample of dyn. smart rendering loaded from JSON.

OK, at first I had no clue what you were talking about because I didn’t have a dhtmlxgrid_json.js file, but then a few days later 2.0 was released which does have this file.  Looking at this file it appears that there is no way to set per-cell settings such as type and colspan.  I would like to be able to do something like this:  rows:[{id:1,data:[{colspan:6,type:“ro”,content:“Something”}]}].  But, you comment “in case of JSON, XML attributes mapped to the properties” makes me think that all XML properties are available in JSON.

As for your offer to create a sample PHP file - thats ok.  But, what I would prefer is a document that simply and completely spells out the XML format, and a document that spells out the JSON format.  There should be a one-stop place for protocol documentation rather than having to sift through mounds of documentation to find what you want like you have to now.

that all XML properties are available in JSON.
To be correct all “row” attributes mapped to related json object properties.

>>But, what I would prefer is a document that simply and completely spells out the XML format
dhtmlx.com/docs/products/docsExp … lGrid.html

Great documentation about the XML format!  I have no idea it existed.  Thanks.  :slight_smile:

So, JSON only supports a subset of features.  Thats frustrating, as JSON is much more compact and effecient on both the client and server side.

I think I’ll stick with continuing to use JSON, and figure out some workaround for my particular issue.

Any chance of getting cell-level configuration in to JSON?  I would expect it wouldn’t be too terribly complex to support an extended format where each cell may be either a simple string in the rows array, or a associative array with name/value pairs for advanced configuration.

I would expect it wouldn’t be too terribly complex to support an extended format where each cell may be either a simple string in the rows array, or a associative array
There is a pretty small update necessary to add such functionality.
Updated dhtmlxgrid_json.js attached to the post, it may accept data as

rows:[
{ id:1001,
data:[
“100”,
“A Time to Kill”,
{value:“12.99”,title:‘custom one’},


dhtmlxgrid_json.zip (1.05 KB)