DataProcessor database updating problem


I experience a problem with my project application.

I use 3 components there: dhtmlxLayout, dhtmlxGrid and dhtmlxScheduler. I also have dhtmlxDataProcessor included so both grid and scheduler can work with MySQL database on the server side.

I can update both grid and scheduler from user interaction of from the script level. The problem appears when trying to do 2 modifications from a single function (after new event is entered into scheduler, I modify one of the grid cell’s value. That triggers both DataProcessor connections (I believe) and only one of them - scheduler - ends successfully. If I use _debug version of dataprocessor, then grid value is saved to the db but not scheduler’s one. Strange…

Any idea why this happen and what’s more important - how to update both values from both components?

You are using 2 instances of dataprocessor, one for grid and one for scheduler right?

Each dataprocessor is independent, and there is no technical limitation on parallel data saving.

Thank you Stanislav, that was my assumption. Yes, I use 2 different instances:
ddpGrid = new dataProcessor( ‘grid_update.php’ );
dpScheduler = new dataProcessor(“events2.php”);

So now it seems I do something wrong, which is the better option since it can be easier to fix :wink:

Please find the attached demo (including db dump).

The demo uses Suite 3.5 and Scheduler 3.5 beta (as of 08.08.2012). But previously I had the same problem with all components being in version 3.0. (529 KB)

You have connector code for the scheduler, and custom saving code for the grid, which is fine - but they expect data in different format. ( scheduler - all data encoded in one request, custom code - simple, one record submit )

To instruct grid’s dataprocessor, to send only one data add the next line

dpGrid.setTransactionMode(“GET”, false);

Hi Stanislav,

Thank you very much for your reply.

I have tried the dpGrid.setTransactionMode(“GET”, false); before but I just did it once again and it alone did not work the magic.

I must admit you lost me here:

What is exactly I should do to both, save new/modified event data and change the value in the grid successfully? Can you provide a code sample how to achieve that according to the demo code?

Many thanks!


Dataprocessor can send data in different formats. It is controlled by setTransactionMode and enabledDataNames commands.

Server side code ( connectors ) expect data as POST, all-at-once
Custom code in grid_update.php expects data as GET and one-record … ding_modes

When scheduler.js included on the page it automatically enables support of connectors, so all dataprocessors will work in POST-all-at-once mode, and you need to use to call setTransactionMode for the grid’s connector manually to change the used protocol for it to GET-one-model

Ok, Stanislav. I got all of this.

Thank you for the explanation, it was a bit complicated but finally it worked. The trick was to place the setTransactionMode call AFTER dataProcessor init for the component.

Again, many thanks!