Behavior of Datatables after updating
Behavior of Datatables after updating
Hi Guys,
I am facing a non-desirable behavior from DataTables after I update a value - after I submit the data, the whole page is refreshed. This doesn't happen when I add or delete a record. Actually, I think the page is not reloaded but is called again like I was loading it for the first time. I lost the filters and the sorting.
I didn't find out any parameter that I should set to prevent this behavior. I would like that the post update action works like the post add or remove rows - just refresh the datatables itself.
Any ideas?
Thank you
I am facing a non-desirable behavior from DataTables after I update a value - after I submit the data, the whole page is refreshed. This doesn't happen when I add or delete a record. Actually, I think the page is not reloaded but is called again like I was loading it for the first time. I lost the filters and the sorting.
I didn't find out any parameter that I should set to prevent this behavior. I would like that the post update action works like the post add or remove rows - just refresh the datatables itself.
Any ideas?
Thank you
This discussion has been closed.
Replies
Allan
Allan
I looked into the problem a little more and decided to compare the behavior of the updating in Chrome, IE and Firefox.
The bad news is that it works perfectly in IE and Firefox :-).
I tested editing a row value and leave the cell clicking on another local of the page. What I realized is that there are two calls to jQuery.event.dispatch. In IE and FF, the first event that calls dispatch is 'blur' and then 'submit'. In chrome, the opposite is done. I don't know if this could cause a different reaction in DataTables...
This post solved the problem when I leave the cell:
http://www.datatables.net/forums/discussion/4470/pagination-is-reset-when-using-a-jeditable/p1
But I still have the problem when I press ... Probably, should I configure something during the aoColumn configuration? There I only used onblur: 'submit'.
So, I disabled the submit action after blur and finish edition with ENTER started working perfectly. But I would like to keep both options - finish updating pressing ENTER or leaving the cell.... Any ideas?
Allan