Datatables : disable first next previous last and show / search record when processing

Datatables : disable first next previous last and show / search record when processing

Unix_GuyUnix_Guy Posts: 20Questions: 0Answers: 0
edited June 2012 in Bug reports
I am using Datatables 1.9 version

[code]

var oTable = $('#example').dataTable( {
"oLanguage": {"sSearch": "Search all columns:",
"sLengthMenu": "Display 100200 records per page"
},
"sPaginationType": "full_numbers",
"bAutoWidth": false,
"iDisplayStart": 0,
"iDisplayLength": 2000,
"bFilter": true,
"bInfo": true,
"bSort": true,
"sScrollX": "100%",
"sScrollY": "500px",
"bScrollCollapse": true,
"bPaginate": true,
"bSortClasses": true,
"bLengthChange": true,
"bProcessing": true,
"bDestroy": true,
"bServerSide": true,
"bDeferRender": true,
"fnServerParams": function ( aoData ) {
aoData.push( { "name": "form_data", "value": data } );
},
"sAjaxSource": "search.py",
"fnServerData": function ( sSource, aoData, fnCallback ) {
$.ajax( {
"dataType": 'json',
"type": "POST",
"url": sSource,
"data": aoData,
"success": function (json)
{
fnCallback(json);
$('html, body').animate({scrollTop:$(document).height()}, 'slow');
document.getElementById("bottom").focus();
},
"error": function (xhr, error, thrown) {
alert("An Error Occurred.!");
}
});
[/code]

The issue is that when I run the search and datatables renders "Processing ..." text the "Show .. Search" and first next previous and last button also gets displayed. Is there a way that I defer there display when datatabales has processed or received response from backend.

*****Lastly this is an excellent tool*****

Replies

  • Unix_GuyUnix_Guy Posts: 20Questions: 0Answers: 0
    Today I tried a lot of ways but I was not getting result as expected. I tried disabling "sPaginationType", "bFilter" and "oLanguage" but it did not helped me. The default content were visible (next and previous buttons + Search[] + Load [xx] record per page). I even tried writing fnDrawCallback function but the objective that when DataTables tool calls backend for data and when it is showing "Processing .." they above are not getting disabled or hidden. I still am able to change the "Display [xx] records per page", "Search all columns" and select first,previous, next last buttons.

    Is there any specific way I can disable to remove them to be displayed when DataTables is "Processing .." to get data from backend for server side processing.

    This tools is really great.
  • snarf2larfsnarf2larf Posts: 64Questions: 0Answers: 0
    You could probably have JQuery hide the elements you don't want before the ajax call is made and then show them after you receive the data. It looks like they all have classes you should be able to easily target to show/hide. I'm not sure if doing this would mess up anything in datatables tables though.
This discussion has been closed.