DataProcessor not updating MySql database

Hi all,

I’m testing dhtmlxSuite and DataStore + DataProcessor particuliary.

My problem : data are not updated in database on CRUD operation.
I have a grid and a form like in the example populated with data from DB:
[url]Start DHTMLX Docs

my code below :

var clientDataStore = new dhtmlXDataStore({url:"dataConnector/client_data.php",datatype:"xml"});
clientDataStore.data.scheme({
		firstname:"Firstname",
        lastname:"Lastname"
});

var grid_1 = cell_1.attachGrid();
grid_1.setIconsPath('./codebase/imgs/');
grid_1.setHeader(["Nom","Prenom"]);
grid_1.setInitWidths("*,150");
grid_1.setColTypes("ro,ro");

grid_1.attachHeader("#text_filter,#text_filter");
grid_1.setColSorting("str,str");
grid_1.setColumnIds("lastname,firstname");
grid_1.init();
grid_1.sync(clientDataStore);

myDP = new dataProcessor("dataConnector/client_data.php");
myDP.init(clientDataStore);
myDP.setUpdateMode("row");

my connector :

require_once "../codebase/connector/data_connector.php";

$res = mysql_connect ( "localhost", "XXXXX", "XXXXX" );
mysql_select_db ( "XXXXX" );

$data = new DataConnector($res, "MySQL");
$data->enable_log("log.txt");
$data->render_table("client","id","lastname,firstname");

When i call myDP.sendData() i can see following logs in the debug frame :

Server url: dataConnector/client_data.php parameters

1
id = 1
!nativeeditor_status = updated
lastname = Douk
firstname = Mory
value = undefined

And the Server response received details

<?xml version='1.0' encoding='utf-8' ?><data><item id='1' ><lastname><![CDATA[Doukoure]]></lastname><firstname><![CDATA[Mory]]></firstname></item> <item id='2' ><lastname><![CDATA[Beaufort]]></lastname><firstname><![CDATA[Emmanuel]]></firstname></item> </data>

Thanks by advance for your help.

Please be sure that connector.js is included on client side.

Yes, connector.js is included.

Is there any requirement on the server configuration ?

Looking at the server response, the problem seems to be on the server-side, isn’t it ?

You have “select” server response instead of “update”
Such can occur in the next cases

a) connector.js is not included
b) dataprocessor was switched to the incorrect mode

Try add one more line to dataprocessor’s config
myDP.setUpdateMode(“row”);
myDP.setTransactionMode(“POST”, true); //this line need to be added

Normally it must work without such extra command. But if somehow code from connector.js is not applied correctly - extra command may help, it will force correct data sending mode for the dataprocessor.

No succes by adding this line.

But I managed to make it work including compiled library

<script  src="codebase/dhtmlx.js"></script>	
<script type="text/javascript" src="codebase/datastore.js"></script>
<script type="text/javascript" src="codebase/connector/connector.js"></script>

instead of independant component

<script src="codebase/dhtmlxcommon.js" type="text/javascript"></script>
<script src="codebase/dhtmlxcontainer.js" type="text/javascript"></script>

<script src="codebase/dhtmlxlayout.js" type="text/javascript"></script>
<script src="codebase/dhtmlxtoolbar.js" type="text/javascript"></script>
<script src="codebase/dhtmlxtabbar.js" type="text/javascript"></script>
<script src="codebase/dhtmlxwindows.js" type="text/javascript"></script>
<script src="codebase/dhtmlxform.js" type="text/javascript"></script>
<script src="codebase/dhtmlxgrid.js" type="text/javascript"></script>
<script src="codebase/dhtmlxgridcell.js" type="text/javascript"></script>
<script src="codebase/ext/dhtmlxgrid_filter.js"></script>

<script src="codebase/connector/connector.js" type="text/javascript"></script>
<script src="codebase/datastore.js" type="text/javascript"></script>
<script src="codebase/dhtmlxdataprocessor.js" type="text/javascript"></script>
<script src="codebase/dhtmlxdataprocessor_debug.js" type="text/javascript"></script>

Is something wrong or missing ?

The order of includes, connector.js must be after dataprocessor.js ( dataprocessor.js is included in the dhtlmx.js, so it case of compiled files - it is correctly included after other js files )

That fix the problem.

Thanks a lot for yout support Stanislav, you save me a lot of time.