Start Building Professional
Web Apps Today


 
Categories Question details Back To List
Question  posted on Nov 11, 2008 11:34
open dhtmlx forum
avoid duplication of ID for same cell

mygrid.xml.cell_attrs=["id"];
mygrid.cells(1,0).setAttribute("id","itemNumber"); //you need not this code if original XML already contains id attribute
mygrid.cells(1,1).setAttribute("id","itemPrice");
mygrid.cells(1,2).setAttribute("id","onStock");

 

how to check if ID is inserted earlier into cells (and saved to DB) to avoid duplication of ID for same cell?

Answer posted by Support on Nov 12, 2008 02:58
>>how to check if ID is inserted earlier into cells
var oldId = mygrid.cells(1,0).getAttribute("id");
if (!oldId) mygrid.cells(1,0).setAttribute("id","itemNumber");