hiding pagination on only 1 results page?

hiding pagination on only 1 results page?

gavingavin Posts: 22Questions: 0Answers: 0
edited September 2009 in General
I'd like to hide this footer..

Showing 1 to 1 of 1 entries ________________ [First][Previous][1][Next][Last]

..when I only have a few results to show. How do I do this?

Replies

  • allanallan Posts: 61,695Questions: 1Answers: 10,102 Site admin
    Hi gavin,

    What you could do is make use of the fnDrawCallback function ( http://datatables.net/usage/callbacks#fnDrawCallback ). If the table is showing only 1 record, then you can just apply .style.display="none" (or visibility:hidden if you want to keep the element in the flow) - otherwise the elements should be shown :-)

    How does that sound?

    Regards,
    Allan
  • gavingavin Posts: 22Questions: 0Answers: 0
    well... I'm not sure how to use fnDrawCallback.

    So what I ended up doing is using PHP to hide or show the following lines:
    [code]
    "bPaginate": false,
    "bInfo": false
    [/code]

    depending if my records are greater than 10 or not.

    that works just fine.
This discussion has been closed.