Hey,
A short overview of my problem:
I have a grid with custom excells. In each of these excells I need to display multiple values from one DB row. So far this is working fine. But now I need to save these values back to the DB as a new row. I don’t want to overwrite the existing row in the DB. The old row should be availabe for tracking purposes. The only way is to use a DataProcessor on client side and a JSONDataConnector on the server side.
But on the server side I’m just getting a string “[object Object]” as return value. So I guess the JSONDataConnector or even the DataProcessor cannot handle a JSON Object as return value.
Here the DataProcessor on the client side.
myGrid = myLayout.cells("a").attachGrid();
myGrid.init();
myGrid.load("connector.php", function () {}, "json");
myGridDataProcessor = new dataProcessor("connector.php");
myGridDataProcessor.init(myGrid);
myGridDataProcessor.enableDataNames(true);
And these are the POST values that were sent to the server by the DataProcessor during an update event.
editing: "true"
660_gr_id: "660"
660_name: "010_0560"
660_status: "[object Object]"
660_!nativeeditor_status: "updated"
660_head: "[object Object], [object Object]"
ids: "660"
As you can see the “status” and even the predefined key “head” are sent as strings, not as objects as expected.
To prevent the JSONDataConnector from default behaviour I’m using your example
docs.dhtmlx.com/connector__php__ … processing
class EventModel{
function update($action){
echo var_dump($action->get_data());
}
}
But still I’m still getting [“status”] => string(15) “[object Object]”.
So I guess something is wrong with the DataProcessor on the client side. I also tried to use the excells examples “myprice” and “mytime” but still i just got a string “[object Object]” as return value.
Just to be sure, on a excell the return value of the getValue() function is send back to the server?
I attached all neccessary files (html including js, php connector and sql dump) cleaned from all unneccessary code and with some comments.
All dhtmlx files are up to date.
Would be pretty awesome to get at least some pseudo code on how to fix this issue.
Thank you for your support in advance.
attachment.zip (4.35 KB)