oncheck change value of another column

Hello,
Im working with Pro Grid and with the php Dataprocessor.

Why does this code not work? Client Side it works beautifully. But not the server side(it doesn’t save the value on the database).

here i call the Event:

mygrid.attachEvent("onCheckbox", doOnCheck);

Here is the function: if the checkbox is checked in column “15” --> change the value to “4” in Column “20” in the same line.

function doOnCheck(rowId, cellInd, state) { if ( (cellInd == '15')&&(state == true) ) { mygrid.cells(rowId, 20).setValue("4"); mygrid.cells(rowId, 20).cell.wasChanged=true; myDataProcessor.setUpdated(rowId, true); return true; } return true; }

But why is it not saving the value to the Database? Help

Does anybody have an idea?

Does your DataProcessor work on autoupdate mode. Try to attach dhtmlxdataprocessor_debug.js and check if DataProcessor trigger row update
docs.dhtmlx.com/doku.php?id=dhtm … bug_mode&s[]=dataprocessor&s[]=debug

Yes my dataprocessor works in autoupdate mode.

It only triggeres one update and this is the default one with the value before i click the checkbox.

I think the problem is that “oncheck” and “autoupdate” colide.

How can i solve this problem?

has anybody any idea here?

I need to change the Values if somebody clicks for example a checkbox…

The problem can be caused by order of event processing.
In moment of onCheckbox event, dataprocessor already sent data to server, so you are updating data too late.

Try to change your code as

mygrid.attachEvent("onEditCell",function(stage, id, ind){ if (stage == 1 && ind == 15) myDataProcessor.setUpdateMode(false); return true; }); mygrid.attachEvent("onCheckbox", doOnCheck); function doOnCheck(stage, rowId, cellInd, state) { if ( (cellInd == '15')&&(state == true) ) { mygrid.cells(rowId, 20).setValue("4"); mygrid.cells(rowId, 20).cell.wasChanged=true; } myDataProcessor.setUpdateMode("cell"); myDataProcessor.sendData(); return true; }

As result, each time when checkbox clicked, data sending will be paused until your custom code not executed.

IMPORTANT - this code need to be placed before myDataProcessor.init

Yes it works now. Thanky you!