Hi,
I have a grid within a form, and submitting the data (only changed) is fine, but the data is in the format mygrid_container_ROWID_COLNUMBER.
I added ID’s to the columns in the XML feed and I can then refer to cells using var field_name = mygrid.getColumnId(col_ID); so I can tell which column is which. ie if(field_name==‘dob’) { // do something }, which is more readable than if(col_ID==8). And if the order of the data changes for some reason, I dont have to change all the javascript.
Is there any way to attach this field name to the cell when submitting the data, so I know which column refers to which field in the database. At the moment I have to use a list of fields so i can convert them back and hope I dont forget to change both data-source and data-save when making alterations.
I have tried using mygrid.enableCellIds(true); before loadXML, after loadXML, in beforeInit and in afterInit, but it doesn’t seem to change anything.
Cheers in advance
Matt
mygrid = new dhtmlXGridObject(‘mygrid_container’);
mygrid.loadXML(“xml.php”);