grid event without dataprocessor

I’m trying to create a test page for demonstrating the capabilities of dhtmlxGrid customized for customer needs, but I’m having some trouble attaching logic into the “onEditCell” grid event.

If I attach an event handler for the event like this:

mygrid.attachEvent(“onEditCell”, function (stage, rId, cInd, nValue, oValue)
if(stage == 2)
// do stuff

The new cell value doesn’t stay in the edited cell but instead the old value stays in the cell.
If I remove the event handler the new values stay in the edited cells, but then I cannot act on cells being edited.

How am I supposed to be doing this please?

You should return true from event handler:

mygrid.attachEvent("onEditCell", function (stage, rId, cInd, nValue, oValue) { if(stage == 2) { return true; } return true; }

Please check more information about “onEditCell” event here … oneditcell

That did the job thanks :slight_smile:

By the way, is that the case for all grid event handlers, that they must have a return value?

It depends on event. Some of event cannot block action execution, for example “onFilterEnd”. You can check more information about each event here