Please how can I clear a table and show _fnProcessingDisplay only when fnDataTablesPipeline is getting the data from the server just like fnReloadAjax does with this.fnClearTable(this);
I'm using 1.9.4 and I will like to stick to that for now because I ve lots of table I wouldn't want to modify for now.
This is the reload code
[code]
$(document.body).on("click", '.reloadContactsData', function(e){
if($.fn.DataTable.fnIsDataTable($('#contactsData')[0])){
oCache.iCacheLower = -1;
$('#contactsData').dataTable().fnDraw();
}
e.preventDefault();
});
[/code]
but the data is still in the table while bProcessing is display.
What I want is to display ONLY "bProcessing" while fnDataTablesPipeline fetches the data from the server just like fnReloadAjax .
Ah I see - there isn't an option for that - sorry. You would need to modify the DataTables core code to do that - which you are of course welcome to do, it is open source :-)
I tried modifying fnDataTablesPipeline() to use .fnClearTable(this); before $.getJSON( sSource, aoData, function (json) but I couldn't reference the table. Is there a way to know the current table in the function fnDataTablesPipeline?
Replies
It adds an option to the API so you might use `table.clearPipeline().draw( false )` to redraw the table.
This is of course dependent on using DataTables 1.10 and the new code.
For the old version you need to modify the `oCache.iCacheLower` parameter (set it to -1) and then redraw the table.
Allan
I'm using 1.9.4 and I will like to stick to that for now because I ve lots of table I wouldn't want to modify for now.
This is the reload code
[code]
$(document.body).on("click", '.reloadContactsData', function(e){
if($.fn.DataTable.fnIsDataTable($('#contactsData')[0])){
oCache.iCacheLower = -1;
$('#contactsData').dataTable().fnDraw();
}
e.preventDefault();
});
[/code]
but the data is still in the table while bProcessing is display.
What I want is to display ONLY "bProcessing" while fnDataTablesPipeline fetches the data from the server just like fnReloadAjax .
Allan
I tried modifying fnDataTablesPipeline() to use .fnClearTable(this); before $.getJSON( sSource, aoData, function (json) but I couldn't reference the table. Is there a way to know the current table in the function fnDataTablesPipeline?