Dhtmlx Grid and DataProcessor

Hello,



I am using the Dhtmlx grid(Inside dhtmlxWindows) and DataProcessor combination for server postback containing all the data in the grid.The grid contains two columns one being of type Checkbox and other being String.

I tried using the combination of myDataProcessor.enablePartialDataSend(false) and mygrid.submitOnlyChanged(false) commands to post back all the rows on grid to server.

My code looks like:



var dhxWins= new dhtmlXWindows();



var win02=dhxWins.createWindow(“w2”,100,30,700,500);



var grid02 = win02.attachGrid();



grid02.setImagePath("…/Common/Images/");

grid02.setHeader(“Select,Columns”);

grid02.setColumnIds(“Select,Column”);

grid02.setColTypes(“ch,edtxt”);

grid02.setColSorting(“str,str”);



grid02.setInitWidths(“50,200”);

grid02.setColAlign(“left,left”);

grid02.setSkin(“light”);



grid02.loadXML(“Link to server”);

grid02.init();

grid02.submitOnlyChanged(false);



dhxWins.window(“w2”).appendObject(form2);

dhxWins.window(“w2”).center();

dhxWins.window(“w1”).setModal(false);

dhxWins.window(“w2”).setModal(true);



myDataProcessor = new dataProcessor(“Link to server”);

myDataProcessor.setUpdateMode(“off”);

myDataProcessor.setTransactionMode(“POST”,true);

myDataProcessor.enableDataNames(true);

myDataProcessor.enablePartialDataSend(true);



myDataProcessor.init(grid02);



myDataProcessor.attachEvent(“onAfterUpdateFinish”,function(){

dhxWins.window(“w2”).close();

dhxWins.window(“w1”).close();

//doInitGrid();

//doInitdhtmlxWindow01();

//RefreshGrid01();

window.location.reload()

});





And a seperate function to send the data on button click

myDataProcessor.sendData();



In the code the commands following the myDataProcessor.enablePartialDataSend(false) and mygrid.submitOnlyChanged(false)

somehow stop executing. Is there any specific sequence in which the code above needs to be written?



Right now if omit the two commands above the page works fine, but only posts back the altered rows.



Thanks


Instead of using enablePartialDataSend(false) and submitOnlyChanged(false) you can manually set state of the row as updated:


dp.setUpdated(id,true,“updated”) where id - row Id.


You should call this method to the every row in grid. After calling myDataProcessor.sendData(); all rows which has “updated” mode will be send to the server.


Just to let you know the correct function name is dp.setUpdated(id,true,“updated”)  instead of dp.setUpdate(id,true,“updated”).



Thanks

Yep, you are right, was a my typo in original answer.