Additional Attribute/Parameter and font color in JSON


Hello,<?xml:namespace prefix = o ns = “urn:schemas-microsoft-com:office:office” /><o:p></o:p>



<o:p> </o:p>



I tried to add a additional Attribute/Parameter and font color in JSON as shown below:<o:p></o:p>



<o:p> </o:p>



data={rows:[<o:p></o:p>



       {id:1, selected:true, style:“color:red;”, userdata:{“name1”:“abc||123||@#$”}, data:[“10”, {“value”:“Row 1 - Column 2”, style:“color:blue”}, {“value”:“Row 1 - Column 3”,“type”:“ed”}]},<o:p></o:p>



                   {id:2, style:“color:green;”, userdata:{“name1”:“xyz||abc||123||@#$”}, data:[“20”, {“value”:“Row 2 - Column 2”, style:“color:red”}, “Row 2 - Column 3”]}<o:p></o:p>



                ]}<o:p></o:p>



<o:p> </o:p>



mygrid.parse(data, “json”);<o:p></o:p>



<o:p> </o:p>



With the above code - I could not able to see the data of where I specified �value�(2nd & 3rd  columns of 1st row and 2nd column of 2nd row) and styles are also not applied to the cells and rows.<o:p></o:p>



<o:p> </o:p>



and code for retrieve the additional attribute:<o:p></o:p>



<o:p> </o:p>



function showAttribute() {<o:p></o:p>



    alert(mygrid.getRowAttribute(1, ‘name1’));<o:p></o:p>



}<o:p></o:p>



<o:p> </o:p>



With the above code - I could not able to retrieve the additional parameter value. This code is working fine with xml data.<o:p></o:p>



<o:p> </o:p>



Please let me know your views and is there other JS files need to include.<o:p></o:p>



<o:p> </o:p>



Thanks,<o:p></o:p>



RamaRao R. <o:p></o:p>

Please check that dhtmlxgrid_json.js is included.