JSON responses

Hi!

Docs:
Since the version 4.1 dataProcessor can work with JSON responses.
Since version 4.1 of DHTMLX library dataProcessor can be used not only with dhtmlxConnector, but also with server-side REST API.
REST API returns a JSON object, thus giving dataProcessor the ability to work with JSON responses.
To set the REST mode, use the setTransactionMode() function with the REST parameter.

Question:
JSON responses works only in REST mode, or in POST too?
If possible send JSON response to dataProcessor, what format it will be?

Hello,
the JSON responses works in all modes.
Generally, the response should contain the same info as a regular xml response, i.e action, sid, tid values

{ "action":"inserted", "sid":122111234, "tid":5}

However it now should work correctly if you return any arbitrary object - in case a response object does not contain these properties, the client-side component will assume the values from it’s current state

Hello!

Sending (for example) {status:ok} json response call popup with “the page at *** says: {status:ok}”.

Maybe any error in code?

Client-side:

Server-side:

<? $data = array( array("id"=> "1", "start_date" =>"12/11/2014 14:00", "end_date" =>"12/12/2014 17:00"), array("id"=> "2", "start_date"=>"12/15/2014 12:00", "end_date" =>"12/18/2014 19:00") ); if($_POST[ids]){ echo "{status:ok}"; //popup } else{ echo PhpToJSObject($data); //[{'id':'1','start_date':'12/11/2014 14:00','end_date':'12/12/2014 17:00'},{'id':'2','start_date':'12/15/2014 12:00','end_date':'12/18/2014 19:00'}] } ?>

Response body content only {status:ok}.

Thank you!

Response text just need double quotes. Like {“status”:“ok”}.