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");
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.
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 )