Viewing All Records

Viewing All Records

xtremer360xtremer360 Posts: 84Questions: 2Answers: 0
edited July 2011 in General
I have this however I have a button on the page with a class of viewAll to where I want it to display ALL rows instead of just displaying 10 with the pagination. How is this accomplished?

[code]
$(document).ready(function() {

var oTable = $('#contentPagesPageList').dataTable( {
"sDom": 'rti<"pagination"p>',
"iDisplayLength": 10,
"sPaginationType": "full_numbers"
} );

$('.viewAll').click(function() {
?
)};

)};
[/code]

Replies

  • allanallan Posts: 63,523Questions: 1Answers: 10,473 Site admin
    http://datatables.net/plug-ins/api#fnLengthChange and pass it -1 as the parameter.

    Allan
  • xtremer360xtremer360 Posts: 84Questions: 2Answers: 0
    edited July 2011
    Thank you Allen. What if I want to have it go BACK to the pagination view.

    Also for some reason the following code causes the script to not work.

    [code]
    $('.viewAll').click(function() {
    oTable.fnLengthChange( -1 );
    )};
    [/code]
This discussion has been closed.