Start Building Professional
Web Apps Today


 
Categories Question details Back To List
Question  posted on Nov 06, 2008 08:06
open dhtmlx forum
dhtmlxGrid loading json

How can I set cell id in json loading? In the following example, it passes cell value only. When I serialize my grid, I need cell id and value.

{
rows:[
{ id:10910,
data:[
"400",
"Cousin Bette",
"Honore de Balzac",
"0",
"1",
"12/01/1991"] }
]

}
Answer posted by Support on Nov 06, 2008 09:57
You can use updated json extension
        http://dhtmlx.com/docs/products/kb/index.shtml?cat=search&page=1&q=5673&ssr=yes&s=json%20cell%20attribute
which allow to define cell level attributes
Answer posted by rashmipanditj@gmail.com on Nov 06, 2008 11:12
Thank you so much for the quick response!
By using this extension, my grid renders fine if I pass "id" and "value" attribute but when I serialize the grid, I don't get my cell "id" back.
Answer posted by Support on Nov 10, 2008 01:04
You can use the following approach in order to include custom attribute into serialization:

grid.xml.cell_attrs.push("id");

Please, see the article:
http://www.dhtmlx.com/docs/products/dhtmlxGrid/doc/articles/Loading_data_in_grid.html#k2tm

Serializtion level should contain "full xml" as enabled:

grid.setSerializationLevel(false,true,....);