Start Building Professional
Web Apps Today


 
Categories Question details Back To List
Question  posted by raj on May 02, 2008 04:02
open dhtmlx forum
problem with header column names when update/insert using Dataprocessor

Hi,

I am using dhtmlxgrid in my application, and I am using DataProcessor to update/insert/delete data into database,

But I am getting the problem with header column names while I try to retreive the data from request at server side,
I am getting all the column header names as undefined...

In my grid I am using multilevel header,
here is my code follows........


mygrid = new dhtmlXGridObject('gridbox');
mygrid.setHeader(levelHeader);
mygrid.attachHeader(header);
mygrid.setInitWidths("100,100,100,100,100,100,100");
mygrid.setColTypes("ed,ed,ed,ed,ed,ed,ed");
mygrid.init();
mygrid.loadXML('loadGrid.do?method=processGrid¶m1=emp');

myDataProcessor = new dataProcessor('loadGrid.do?method=processGrid¶m1=emp');
myDataProcessor.enableDebug(true);
myDataProcessor.enableDataNames(true);

myDataProcessor.setUpdateMode("off");//available values: cell (default), row, off
myDataProcessor.defineAction("error",myErrorHandler);
myDataProcessor.setTransactionMode("GET");
myDataProcessor.init(mygrid);
myDataProcessor.sendData();


Can u please suggest me regarding this............I am not able to move further from here.

/Thanks
Raj
Answer posted by Support on May 02, 2008 05:50
>> myDataProcessor.enableDataNames(true);
In case of such command grid will use column IDs as name of parameters ( not the labels from grid header )
Basically you need to add one more line to the grid initialization

    grid.attachHeader(header);
    grid.setColumnIds(header); // here the ID's of columns need to be set