Refresh table after ajax success
Refresh table after ajax success
subzerillo
Posts: 2Questions: 0Answers: 0
Hello.
First of all, thanks for creating such a great api to display awesome tables.
I have been struggling with the refreshing of the table for almost 2 days, searched for an answer on the documentation, and forums, but nothing is working for me.
Here is the debug of my datatable:
http://debug.datatables.net/itenus
My ajax to delete the row is working well, but after the ajax is done. Im trying to update the table without any success
This is the code to ajax delete the row on the server side and then update the table:
[code]
$('#sortable-table tbody').click(function(e){
$(oTable.fnSettings().aoData).each(function(){
$(this.nTr).removeClass('row_selected');
});
$(e.target.parentNode).addClass('row_selected');
})
function fnGetSelected( oTableLocal )
{
var aReturn = new Array();
var aTrs = oTableLocal.fnGetNodes();
for ( var i=0 ; i
First of all, thanks for creating such a great api to display awesome tables.
I have been struggling with the refreshing of the table for almost 2 days, searched for an answer on the documentation, and forums, but nothing is working for me.
Here is the debug of my datatable:
http://debug.datatables.net/itenus
My ajax to delete the row is working well, but after the ajax is done. Im trying to update the table without any success
This is the code to ajax delete the row on the server side and then update the table:
[code]
$('#sortable-table tbody').click(function(e){
$(oTable.fnSettings().aoData).each(function(){
$(this.nTr).removeClass('row_selected');
});
$(e.target.parentNode).addClass('row_selected');
})
function fnGetSelected( oTableLocal )
{
var aReturn = new Array();
var aTrs = oTableLocal.fnGetNodes();
for ( var i=0 ; i
This discussion has been closed.
Replies
Thanks for your answer.
But already tried all those combinations.
Tried this:
[code]
$.ajax ({
type: "POST",
url: BASE + '/destroy',
data: { deleteID : deleteID }
}).done(function(data){
oTable.fnDraw(true);
});
[/code]
and this:
[code]
$.ajax ({
type: "POST",
url: BASE + '/destroy',
data: { deleteID : deleteID }
}).done(function(data){
oTable.fnReloadAjax();
});
[/code]
All with the same result, not refreshing my datatable on the browser.
If someone could guide through the process of a simple datatable refresh with server side processing, I will be very grateful.
Thanks.