Start Building Professional
Web Apps Today


 
Categories Question details Back To List
Question  posted on Dec 29, 2008 08:13
open dhtmlx forum
custom attribute to row

Hi,

We are inserting new row into existing grid:

for(var i=0; i< data.length; i++)
{
Grid.addRow(i+1,data[i],i);
Grid.setUserData(i+1,"abclId",abcArray[i]);
}
We want to add the custom attribute to that row using JavaScript, instead of using API function setAttribute("abclId",abcArray[i]);

Please advise.

Thanks
Answer posted by Support on Dec 29, 2008 16:25
>>instead of using API function setAttribute("abclId",abcArray[i]);
What is the problem with setRowAttribute method usage ?

Grid.addRow(i+1,data[i],i);
Grid.setRowAttribute(i+1,"abclId",abcArray[i]);

http://dhtmlx.com/docs/products/dhtmlxGrid/doc/articles/Storing_additional_data.html#grid_art_userdata

Added value will be equal to atribute loaded from XML ( if you need to add it to serialization, you will need to configure some more settings )