Inline edit of one cell with only this one updated field in the ajax answer?
Inline edit of one cell with only this one updated field in the ajax answer?
edm
Posts: 19Questions: 6Answers: 0
Hi,
when i edit one table cell (Inline edit), then the server have to send all column values for the whole row in the ajax answer. Is it possible to answer only the updated cell content? It's a lot of work to collect the other column informations.
This discussion has been closed.
Answers
why not have a separate ajax call that gets just the needed data and updates the row in question?
Are you having performance issues that make the recoding effort worth the trouble?
What you are looking for should actually be possible with Editor 1.6 now. What version of Editor are you using?
Allan
I am using DataTables-1.10.15 and Editor 1.6.2 (since today).
My point of view: If i update only one cell (inline editing), then the ajax answer from the server to the client should affect only this cell. How it is possible with version 1.6?
It should just happen automatically. Editor stores a copy of the data that was sent to the server and extends that based on what is returned.
Allan
This sounds very good, but do not work for me. I receive this _POST array (ignore the waste "employee" line):
and send back the whole row content to the client:
That works.
But if i left some/many of the columns, eg
{"data":[{"DT_RowId":"jobgroupId-1_employeeToken-SKH","fr":1}]}
i got an error:
DataTables warning: table id=table_weeksGroupsTable1 - Requested unknown parameter 'employeeAndWorkload' for row 5, column 0. For more information about this error, please see http://datatables.net/tn/4
How should the server answer looks like?
The issue is that Editor will extend what it sends to the server. Not what currently exists in the DataTable for that row. So if you are only sending
employee
andfr
, those are the only two parameters that the server could not respond with...I can certainly see how it would be useful to be able to use the whole row and I will look into that in future. For the moment, the only option would be to use
postSubmit
, get the data for the edited row from the DataTable and do a$.extend()
on that.Regards,
Allan
Ah, this is not my way of thinking in that case.
Ok, i am waiting and i do hope for that feature (server answer affects only changed content) in the near future . Thank you for explanation.