fnDeleteRow doest not delete When using ServerCall to load Data
fnDeleteRow doest not delete When using ServerCall to load Data
blpraveen2004
Posts: 15Questions: 2Answers: 0
I modified the dataTable to load using a fnServerData. But fnDeleteRow doesnot deleting the rows now.
[code]
/* Get the rows which are currently selected */
function fnGetSelected( oTableLocal )
{
return oTableLocal.$('tbody tr.row_selected');
}
//DataTable
oTable = $('#table_data').dataTable({
"bProcessing": true,
"bServerSide": true,
"sAjaxSource": woocommerce_writepanel_params.ajax_url,
"fnServerData": fnDataTablesPipeline,
"bAutoWidth": false
});
//Performing Ajax function to delete the selected rows
var anSelected = fnGetSelected( oTable );
jQuery.ajax({
type: "POST",
data: post_data,
url: 'ajax.php',
success: function(response) {
$('#variable_product_options').stop(true).css('opacity', '1').unblock();
$.each(anSelected,function(i,v) {
oTable.fnDeleteRow(anSelected[i]);
});
}
});
[/code]
[code]
/* Get the rows which are currently selected */
function fnGetSelected( oTableLocal )
{
return oTableLocal.$('tbody tr.row_selected');
}
//DataTable
oTable = $('#table_data').dataTable({
"bProcessing": true,
"bServerSide": true,
"sAjaxSource": woocommerce_writepanel_params.ajax_url,
"fnServerData": fnDataTablesPipeline,
"bAutoWidth": false
});
//Performing Ajax function to delete the selected rows
var anSelected = fnGetSelected( oTable );
jQuery.ajax({
type: "POST",
data: post_data,
url: 'ajax.php',
success: function(response) {
$('#variable_product_options').stop(true).css('opacity', '1').unblock();
$.each(anSelected,function(i,v) {
oTable.fnDeleteRow(anSelected[i]);
});
}
});
[/code]
This discussion has been closed.
Replies
Since you are using pipelining you'd need to empty the pipeline as well. Otherwise, obviously, it will use the cached data.
Allan
[code]
oCache.iCacheLower = -1;
table.fnDraw();
[/code]
to do a full refresh from the server.
The new pipeline code for 1.10 adds an API method to DataTables to allow the cache to be emptied on a per table basis.
Allan
I have set pipeline limit to 50, pagination is not working after I go to 5th page.
Link to page
http://shop2build.com/fawaaz/product/tractor-emulsion-smooth-wall-finish-10-lts-2/
And also processing does not go off after load.