Need more explanation about response from server to Editor after successful "CREATE"
Need more explanation about response from server to Editor after successful "CREATE"
Hi Allan,
I have a question about the response returned by the server to editor.
According to your "Client/server data" manual, Editor expects a JSON object to be returned.
But I'm a bit lost and I would need your advice on what would be the correct response for the "CREATE" example below:
(Please note I'm using legacyAjax = true, because I don't need multi-row functionalities).
SENT TO SERVER
action = create
data[job] = Assistant
data[first_name] = Fiona
JSON RESPONSE SENT BACK FROM SERVER TO EDITOR:
RESPONSE 1
{
"data": [
{
"DT_RowId": "row_29",
"first_name": "Fiona",
"job": "Assistant"
}
]
}
RESPONSE 2
{
"data": [
{
"first_name": "Fiona",
"job": "Assistant"
}
]
}
RESPONSE 3
"data": [
{
"first_name": "Fiona",
"job": "Assistant"
}
]
RESPONSE 4
"data":
{
"first_name": "Fiona",
"job": "Assistant"
}
RESPONSE 5
{
"first_name": "Fiona",
"job": "Assistant"
}
RESPONSE 6
"data":
{
"DT_RowId": "row_29",
"first_name": "Fiona",
"job": "Assistant"
}
Thanks a lot Allan!
Regards,
This question has an accepted answers - jump to answer
Answers
Hi,
The problem here is that the legacy mode uses
row
rather thandata
- see the legacy client / server documentation.Also it is an object rather than an array since the legacy format doesn't support multiple rows.
For example you would probably want:
Regards,
Allan
Thank you Allan, so I will check again the documentation.
Regards,