GET aaData for table with Editor response

GET aaData for table with Editor response

balnysbalnys Posts: 10Questions: 1Answers: 0
edited August 2013 in Editor
Hi everyone,

I am trying to use Editor create method to get data for a table with server response.

For example:
[code]
// Client sends:
{
"id": -1,
"table": "",
"action": "create",
"data": {
"browser": "Chrome",
"engine": "Webkit",
}
}
[/code]

[code]
// Return from server:
{
"id": -1,
"error": "",
"fieldErrors": [],
"data": [],
"aaData": [
{
"DT_RowId": "row_1",
"version": 10,
"grade": "A",
},
{
"DT_RowId": "row_2",
"version": 12,
"grade": "+A",
},
{
"DT_RowId": "row_3",
"version": 14,
"grade": "++A",
}
]
[/code]

I am willing to use this to get filtered data from server and want to implement it through Editor form (i.e. send keywords through form and get result in response)

Is this way would be the right way to achieve such task? Or even is it possible?

Any ideas are welcome.

Replies

  • allanallan Posts: 63,531Questions: 1Answers: 10,475 Site admin
    At this time, Editor expects only one row to be returned from the server when it makes a `create` Ajax call - the row that was created. Something like:

    [code]
    // Return from server:
    {
    "id": "row_90",
    "row": {
    "browser": "Chrome",
    "engine": "Webkit",
    "platform": "Win / Mac / Linux",
    "version": "535.1",
    "grade": "A"
    }
    }
    [/code]

    Documentation here: http://editor.datatables.net/server/

    Is it that you want to reload the data for the whole table? If so, you'd need to use the fnReloadAjax plug-in with Editors onPostCreate method.

    Regards,
    Allan
This discussion has been closed.