Show all results in datatable.

114 views
Skip to first unread message

Alex Penedo

unread,
Jan 8, 2015, 5:36:35 AM1/8/15
to tapestry...@googlegroups.com
I have Datatable with server side and I want to add the option to show all rows. I added this in my datatables options:
JSONObject language = new JSONObject("sSearch", " ", "sLengthMenu",
"<select>" + "<option value='20'>20</option>"
+ "<option value='50'>50</option>"
+ "<option value='100'>100</option>"
+ "<option value='500'>500</option>"
+ "<option value='-1'>*</option>"
+ "</select>", "sInfo", " ", "sProcessing", "...");
 But no matching records found. I have a function that returns me the total number of rows at database, but sometimes crashes with StackOverflow.


Emmanuel DEMEY

unread,
Jan 14, 2015, 5:39:39 AM1/14/15
to tapestry...@googlegroups.com
According to this documentation http://legacy.datatables.net/ref, you have maybe specified the sLengthMenu in the wrong place: 

$(document).ready( function() {
  $('#example').dataTable( {
    "oLanguage": {
      "sLengthMenu"'Display <select>'+
        '<option value="10">10</option>'+
        '<option value="20">20</option>'+
        '<option value="30">30</option>'+
        '<option value="40">40</option>'+
        '<option value="50">50</option>'+
        '<option value="-1">All</option>'+
        '</select> records'
    }
  } );
} );
Reply all
Reply to author
Forward
0 new messages