Start Building Professional
Web Apps Today


 
Categories Question details Back To List
Question  posted by RamaRao R on Jan 20, 2010 02:01
open dhtmlx forum
Grid with JS Array and JSON data formats

Hello,

I am working on Grid, as per our application data model I have to go with JS Array or JSON formats only. In my evaluation, I am looking for your thoughts on:

1.       How to specify ID explicitly in Array data?

2.       How to provide additional parameter/attribute to the row in JS Array data and JSON?  I checked XML additional attribute format but I could not able to apply to JS Array and JSON data formats.

3.       How to add font color/style and background color to the ROW and CELL in the JS Array and JSON?

Please let me know your thoughts and send the complete data formats of JS Array and JSON.

 

Thanks,

RamaRao R.

Answer posted by Alex (support) on Jan 20, 2010 02:28

Hello

loading from jsarray allows to pass only cell values. There isn't a opportunity to pass row ids or some other attributes.

json loading is much more flexible. You can load the same attributes and tags as in case of xml loading. 

The example of setting style attribute for a row and a cell:

data={
   rows:[
      { id:1,
        style:"color:red",
        data:[
             "some value in the 1st cell",
             {value:"some value in the 2nd cell",style:"color:blue"},
              "some value in the 1st cell"
        ]

     }

   ]
  }