Hide Pagination Buttons When Data Not Available Serverside

Hide Pagination Buttons When Data Not Available Serverside

rocky14rocky14 Posts: 1Questions: 1Answers: 0

Hide paggination when data not available in table.

dataTable = $('#example').DataTable({
"processing": false,
"serverSide": true,"bInfo": true,"stateSave":true,
"lengthMenu": [ [10, 25, 50,-1], [10, 25, 50,"All"] ],"paging": true,
"oTableTools": {
"sSwfPath": "assets/js/plugin/datatables/swf/copy_csv_xls_pdf.swf",
"aButtons": [
{
"sExtends": "print",
"sButtonText": "Print",
"mColumns": "visible",
},
{
"sExtends": "collection",
"sButtonText": "Export",
"aButtons": [
{
"sExtends": "csv",
"sButtonText": "CSV",
"mColumns": "visible"
},
]
}
]
},
"ajax":{
url :"base/abc", // json datasource
type: "post", // method , by default get
error: function(e,responseText1,responseText){ // error handling
$("#ErrorDataTable").html('<tr><th colspan="4">

'+responseText+'

</th></tr>');
}
},
"columns": [{"data":"abc"},{"data":"abc"},{"data":"abc"},{"data":"abc"}],
"sDom": "<'dt-toolbar'<'col-xs-12 col-sm-6'T><'col-sm-6 col-xs-12 hidden-xs'l>r>"+"t"+"<'dt-toolbar-footer'<'col-sm-6 col-xs-12 hidden-xs'i><'col-xs-12 col-sm-6'p>>",
"autoWidth" : true,
} );

This discussion has been closed.