Quantcast
Channel: Editor — DataTables forums
Viewing all articles
Browse latest Browse all 3740

After create: can "row" be told to expect a JSON object?

$
0
0

https://editor.datatables.net/manual/server

I'm looking at this and it makes sense on how I can send back some additional fields after sending the new record to the server, and getting fields back such as the ID of the database record, the name of the record creator, the timestamp, and more.

The Ajax call will now return the data in a JSON structure with the name of "row", but I just realized that I'm sending it as a true object and DataTables seems to be expecting an array.

For clarity, an example of what got sent back after a successful Ajax call to the server for a create event. The structure is a valid JSON object (but not an array).

{
    "row": [
        {
            "technology_id": "3",
            "change_data_ind": "Y",
            "language_cd": "en",
            "updated_local_ts": "Apr 29, 2015 5:42pm",
            "technology_note_id": "10",
            "session_id": "75bbd3fa3068f81e8667b5b0cd24c6df",
            "created_user": "Peter Smith",
            "DT_RowId": "row_10",
            "updated_gmt_ts": "2015-04-30 00:42",
            "note_txt": "69"
        }
    ]
}

Is there a parameter here to tell DataTables to expect a true JSON object?


Viewing all articles
Browse latest Browse all 3740

Trending Articles