hi,
I am using dhtmlx grid + connector (connected to a mysql-database). if I add a new data record with the addrow function
function addRow(){
var newId = (new Date()).valueOf()
mygrid.addRow(newId,[’’,‘test’,’’,’’,’’,’’,’’,’’,’’,’’,’’,’’,’’,’’,’’,’’,’’,’’],mygrid.getRowIndex(mygrid.getSelectedId()))
mygrid.selectRow(mygrid.getRowIndex(newId),false,false,true);
}
a new grid line is added but if I click to edit the data it is not updated correctly. The font color gets red and if I reload the page I see that nothing was updated. If I use addrow then reload the page and then update it works.
It has to do with grid not using the correct ID (auto increment is on). For example I use … [’’,‘test’,’’,’’,’’,’’,’’,’’,’’,’’,’’,’’,’’,’’,’’,’’,’’,’’]… in the above script, and the first “” is for the ID field. So if I know for example that the next ID will be “15” and I change the script to … [‘15’,‘test’,’’,’’,’’,’’,’’,’’,’’,’’,’’,’’,’’,’’,’’,’’,’’,’’]… the updating after addrow works as expected, but only for this ID.
So how can I get updating a grid cell after addrow with auto increment and connector to work?
Thanks!