I am having some difficulty with using cntr on DHTMLX grid and data processor. I have all my data coming in from a mySQL DB and loading just fine. The problem is that I added the cntr row at the beginning and now everything is off by one column and the last column is blank.
I assume that this has to do with the mygrid.setColumnIds line…but not sure.
Here is what I have:
html>
Save Data dynamicaly
|
* - fields which shouldn’t have empty value marked with red border. |
Add row Remove Selected Row Enable Auto Update Cell based Row based |
//init grid and set its parameters (this part as always)
mygrid = new dhtmlXGridObject(‘gridbox’);
mygrid.setImagePath("…/…/includes/dhtmlx/Grid/codebase/imgs/");
var flds = " ,Store,Name,District,Territory,Address,City,State,Zip Code,Longitude,Latitude,Retailer,Create Date,Modify Date";
mygrid.setHeader(flds);
mygrid.setInitWidths(“40,60,100,70,70,*,125,60,70,80,80,100,100,100”)
mygrid.setColAlign(“center,center,left,center,center,left,left,center,right,right,right,center,center,center”)
mygrid.setColTypes(“cntr,ed,ed,ed,ed,ed,ed,ed,ed,ed,ed,ed,calendar,calendar”);
mygrid.setColumnIds("$nbsp;,store,name,district,territory,address,city,state,zip,lng,lat,type,create,modify")
mygrid.setSkin(“modern”);
mygrid.setColSorting(“na,str,str,str,str,str,str,str,str,str,str,str,date,date”)
mygrid.init();
//============================================================================================
mygrid.loadXML(“php/get.php”);
myDataProcessor = new dataProcessor(“php/update.php”);
//myDataProcessor.enableDebug(true);
myDataProcessor.enableDataNames(true);
myDataProcessor.setVerificator(1)
myDataProcessor.setVerificator(3,checkIfNotZero)
myDataProcessor.setUpdateMode(“off”);//available values: cell (default), row, off
myDataProcessor.defineAction(“error”,myErrorHandler);
myDataProcessor.setTransactionMode(“GET”);
myDataProcessor.init(mygrid);