jQuery datatables refresh data not working
jQuery datatables refresh data not working
i can use server side to fill datatables and other working that but i cant refresh data after clicking on `reload_table` element.clear datatable is work correctly but draw not working.
[code]
$('#reload_table').live('click',function(){
oTable_topics.fnReloadAjax(oTable_topics.fnSettings());
oTable_topics.fnClearTable();
oTable_topics.fnDraw();
$.ajax({
url: "server_processing.php",
success: function() {
// if it worked, ask datatable to redraw the table with the new data
$("#showTopics").dataTable().fnDraw();
// if this js function does anything useful (like deleting the row), then call it:
Success();
},
error: function() {
// display any error (like server couldn't be reached...), or at least try to log it
}
});
});
oTable_topics =$('#showTopics').dataTable({
"bLengthChange": false,
"iDisplayLength": 12,
"bScrollCollapse": true,
"bJQueryUI": true,
"bAutoWidth": false,
"sAjaxSource": "server_processing.php",
"sPaginationType": "full_numbers",
"bProcessing": true,
"fnDrawCallback": function(oSettings) {
clickRowHandler_topics();
if ( oSettings.aiDisplay.length == 0 )
{
return;
}
var nTrs = $('tbody tr', oSettings.nTable);
var iColspan = nTrs[0].getElementsByTagName('td').length;
var sLastGroup = "";
for ( var i=0 ; i
[code]
$('#reload_table').live('click',function(){
oTable_topics.fnReloadAjax(oTable_topics.fnSettings());
oTable_topics.fnClearTable();
oTable_topics.fnDraw();
$.ajax({
url: "server_processing.php",
success: function() {
// if it worked, ask datatable to redraw the table with the new data
$("#showTopics").dataTable().fnDraw();
// if this js function does anything useful (like deleting the row), then call it:
Success();
},
error: function() {
// display any error (like server couldn't be reached...), or at least try to log it
}
});
});
oTable_topics =$('#showTopics').dataTable({
"bLengthChange": false,
"iDisplayLength": 12,
"bScrollCollapse": true,
"bJQueryUI": true,
"bAutoWidth": false,
"sAjaxSource": "server_processing.php",
"sPaginationType": "full_numbers",
"bProcessing": true,
"fnDrawCallback": function(oSettings) {
clickRowHandler_topics();
if ( oSettings.aiDisplay.length == 0 )
{
return;
}
var nTrs = $('tbody tr', oSettings.nTable);
var iColspan = nTrs[0].getElementsByTagName('td').length;
var sLastGroup = "";
for ( var i=0 ; i
This discussion has been closed.