Hide drop down for row display length and default length to all

Hide drop down for row display length and default length to all

jcjc Posts: 2Questions: 0Answers: 0
edited March 2011 in General
This is a great tool, thank you so much for it.
Is there a way to hide the display length - the drop down to choose how many records to display? I'd like to remove this and have the display default to "all" the records I'm returning in my query. I've looked through the datatables usage and the options, but cannot seem to find a way to do this. I probably missed it.

Thanks,
jc

Replies

  • zchapplezchapple Posts: 13Questions: 0Answers: 0
    Hi JC. I tried finding this earlier, while I could not get it to work in combination with something else I was doing I was able to get it work by itself. Take a look at the following thread.

    http://datatables.net/forums/comments.php?DiscussionID=2670
  • jcjc Posts: 2Questions: 0Answers: 0
    zchapple,
    Thanks for the post. I'll give it a try.
    I realized earlier that I could just use jQuery to hide the display.
    [code]
    $('#reports').dataTable({
    "bStateSave": true
    });

    // hide the drop down menu and nav icons
    $('#reports_length').css("display", "none");
    $('#reports_next').css("display", "none");
    $('#reports_previous').css("display", "none");
    [/code]

    Not ideal for sticking with the dataTable code, but works.
    Thanks again for the post.
    much appreciated!

    --jc
  • zchapplezchapple Posts: 13Questions: 0Answers: 0
    JC,

    You are welcome, I am glad I was able to point you in a possible direction. I am still learning a lot about DataTables but so far it is awesome.
This discussion has been closed.