Inline Editor mode, and updating single column with confirmation

Inline Editor mode, and updating single column with confirmation

webusr91webusr91 Posts: 12Questions: 5Answers: 0

When using inline Editor mode, and updating single column, is it possible to just update the data into database on the server side, and not have the send back the entire Table row record again from server side, and instead just a confirmation.

For example on this example page,
https://editor.datatables.net/examples/inline-editing/simple

TO SERVER:

When a column is updated following data goes to server,
action=edit&data%5Brow_1%5D%5Bposition%5D=System+Architect+II+NEW

(When Position is changed from "System Architect II" to "System Architect NEW"

FROM SERVER:

In the response it receives the following,

{"data":[{"DT_RowId":"row_1","first_name":"Tiger","last_name":"Nixon","position":"System Architect II NEW","email":"t.nixon@datatables.net","office":"Edinburgh","extn":"5421","age":"61","salary":"320800","start_date":"2011-04-25"}]}

So it receives the entire ROW data to be updated.


Question:

Instead of receiving back entire row back from server, can we just send back confirmation from server, based on which data on client side will be updated, since nothing else has changed on the client side ?

Since we do column user view permissions checks when generating row data, this is adding additional overhead to send back entire row for each column update.

Thanks

This question has an accepted answers - jump to answer

Answers

  • allanallan Posts: 61,744Questions: 1Answers: 10,111 Site admin

    is it possible to just update the data into database on the server side, and not have the send back the entire Table row record again from server side

    No sorry. At the moment Editor requires that the server respond with the full data set from the server. That might not be the case for 1.6 - I haven't confirmed it yet.

    Allan

  • webusr91webusr91 Posts: 12Questions: 5Answers: 0

    Hi,

    Now that 1.6 has been released, is it possible to provide this functionality, or is there any other work around.

    With the current approach, it's taking lot of load on server to update full row each time a column has been changed.

    Thanks

  • allanallan Posts: 61,744Questions: 1Answers: 10,111 Site admin
    Answer ✓

    In the end that doing go into 1.6, although it is still under review for future (which will be based on feedback such as your own!).

    The only "workaround" would be to use the events such as postSubmit, in combination with the DataTables API to get the data for the row(s) that were edited and then extend the JSON result from the server. Merging the data returned and the old data (allowing the new data to overwrite the old of course) would effectively result in the same thing.

    Allan

  • webusr91webusr91 Posts: 12Questions: 5Answers: 0

    Thank you. Will give a try based on your comments.

This discussion has been closed.