DHTMLX Docs & Samples Explorer

Index
dhtmlxdataprocessor

## Adjusting Server Side Code

If you are using php-connectors - please refer to connectors documentation.

The default package contains an example of the server side code for PHP (by additional request the similar code for JSP|ColdFusion|C#.Net|RybyOnRails can be sent). The code does the following three tasks:

a) Takes parameters from the incoming request;
b) Makes the necessary DB operation;
c) Returns the information about the operation result.

The incoming parameters are:

- gr_id - id of a row in the grid for which some operation is executed;
- !nativeeditor_status - the status of the operation;
- inserted - the row in question was added;
- deleted - the row in question was deleted;
- … any other value … - the row was updated;
- c0 - the data of the first column in the updated row;
- c1 - the data of the second column in the updated row;
  ….
- cN - the data of the (N+1)th column in the grid.

All the parameters are part of GET request.

Based on the value of ”!nativeeditor_status” the related section of the server side logic is triggered.

The response must be in the following format:

      <data>
          <action type="some" sid="some" tid="some" />
      </data>

Where:

- type - the type of the operation (it may be “insert”, “update”, “delete”);
- sid - the original row ID (the same as gr_id);
- tid - the ID of the row after the operation (may be the same as gr_id, or some different one - it can be used during a new row adding, when a temporary ID created on the client side is replaced with the ID taken from the DB or by any other business rule).

The response must be a valid XML in order to be processed correctly.