Redraw table after ajax post
Redraw table after ajax post
jattDaLann
Posts: 5Questions: 0Answers: 0
Awesome plug-in, but I just don't seem to get to redraw my table after I load it up from the server.
What I have is a table on which I use datatables
[code]
$(document).ready(function() {
$("#partnerdashboardPlayer table").dataTable({
"aaSorting": [[6, "desc"]],
"bProcessing": true,
"iDisplayLength": 50,
"sPaginationType": "full_numbers",
"aLengthMenu": [[10, 25, 50, -1], [10, 25, 50, "All"]]
});
});
[/code]
When I get data with an ajax-post data from server, I would like to rebind/redraw my table with the new data to be a datatable.
How can I rebind my new table as a datatable (table has the same id)
[code]
// Get partial view (html)
$("#franchiseDashboardStatistics").load('/Affiliation/Referrer #ReferrerStatistics', values);
// Redraw the table (with the same settings)
$("#partnerdashboardPlayer table").dataTable({
"aaSorting": [[6, "desc"]],
"bProcessing": true,
"iDisplayLength": 50,
"sPaginationType": "full_numbers",
"aLengthMenu": [[10, 25, 50, -1], [10, 25, 50, "All"]]
});
});
[/code]
I guess this is not magic, but I just can't seem to get it work...I've tried fnDraw, but still stuck..and puzzled.
Regards
Jatt
What I have is a table on which I use datatables
[code]
$(document).ready(function() {
$("#partnerdashboardPlayer table").dataTable({
"aaSorting": [[6, "desc"]],
"bProcessing": true,
"iDisplayLength": 50,
"sPaginationType": "full_numbers",
"aLengthMenu": [[10, 25, 50, -1], [10, 25, 50, "All"]]
});
});
[/code]
When I get data with an ajax-post data from server, I would like to rebind/redraw my table with the new data to be a datatable.
How can I rebind my new table as a datatable (table has the same id)
[code]
// Get partial view (html)
$("#franchiseDashboardStatistics").load('/Affiliation/Referrer #ReferrerStatistics', values);
// Redraw the table (with the same settings)
$("#partnerdashboardPlayer table").dataTable({
"aaSorting": [[6, "desc"]],
"bProcessing": true,
"iDisplayLength": 50,
"sPaginationType": "full_numbers",
"aLengthMenu": [[10, 25, 50, -1], [10, 25, 50, "All"]]
});
});
[/code]
I guess this is not magic, but I just can't seem to get it work...I've tried fnDraw, but still stuck..and puzzled.
Regards
Jatt
This discussion has been closed.