Editor not redrawing automatically when using ajax call.
Editor not redrawing automatically when using ajax call.
Link to test case:
http://live.datatables.net/hehowado/1/
Description of problem:
I have three problems/query which could be coming from related thing.
1) When I edit from the regular Edit button it doesn't redraw the table right away and I have to do a reload on success. This is not working great for me as if I am on 5th page and edit some data then when the page reloads on ajax success it throws me back to the same page. I would like something where I don't have to reload the page, just like here . What I am doing wrong here?
2) I am using autoFill extension, which is great but again when I use it with the editor with ajax call. It doesn't update the values on the table and I have to reload to see the reflected changes. Like the changes happens in the database but not in the frontend unless i reload/refresh. This has the same problem as above, that it would always throw me back on the front page.
3) I am using keyTables and editor together. When I edit a value it edits in the database as well as get reflected right away. But when I press enter to edit it the selector goes away after processing. Like the selector doesn't stay where it was (For example if it is editing Row1 Col5, after pressing enter to submit changes the selector should stay there but it doesn't). Is it possible to do?
This question has an accepted answers - jump to answer
Answers
Can you show me the response from the server when you send the Ajax request to update the row please?
The other two questions really revolve around getting that resolved first I think.
Thanks,
Allan
@allan
This is the response I get when I edit with the edit button as well as autofill:
For instance, above I have edited two rows with the IDs ['841', '842']
This is the response I get when I edit with the inline edit:
I have edited the row with id 841 up there!
I understand that I need to send the edited data back. So now the first two problems are solved but the number 3 is still a problem. The selector just go away and you have to use a mouse again to click back on table cell. You can see this behavior in my test case link as well!
It seems to be working in this example here. Could you take a look, please, and see if that helps, or if not, give steps on how to reproduce the issue,
Colin
@colin I already have a test case. Could you please take a look at that? To reproduce you just try to edit a cell with inline editing and you would find that selector just go away. It doesn't work as it should!
The
data
part is wrong in both replies. In the first it isnull
, while in the second it is a string. It should be an array of row value objects. The second one almost looks correct, but it shouldn't be a string - just a plain JSON array.What code are you using on the server-side to process and return this data? Are you using the libraries we provide, or you own homebrew code? If you are using your own code, the documentation for what editor sends and what it expects in return is available here.
Allan
@allan I have corrected the first two issues but the third is still bugging me!
If you use the nightly version of KeyTable that issue is resolved. Updated example: http://live.datatables.net/hehowado/3/edit .
Allan
Awesome! Do you know when it would be released?
Hopefully within the next week. We're aiming for this Friday, but it may slip, so it won't be long,
Colin