Hide entries drop down option & placing search elsewhere.

Hide entries drop down option & placing search elsewhere.

MichaelECMichaelEC Posts: 23Questions: 9Answers: 0

Hello,

I'm just wanting to know if it's possible to hide the entries drop-down option (but keep it set to 50) and move the search box elsewhere, see the screenshots for examples.

From this:

To this:

If I can, please let me know where I can do this, thanks!

This question has accepted answers - jump to:

Answers

  • colincolin Posts: 15,236Questions: 1Answers: 2,598
    Answer ✓

    Hi @MichaelEC ,

    Yep, you can hide the paging and default search with dom, set the default page length with pageLength, then use search() to create you own custom search that you can place in your heading.

    See this example here.

    Cheers,

    Colin

  • MichaelECMichaelEC Posts: 23Questions: 9Answers: 0
    edited September 2018

    Hi @colin ,

    Thanks for this, it's working perfectly!

    I've marked this as answered :)

  • colincolin Posts: 15,236Questions: 1Answers: 2,598
    Answer ✓

    Hi @MichaelEC ,

    Yep, the dom page lists all the options. I hid it as an example - you wanted a search outside of the table container, so it would look odd with two search boxes.

    Did you also copy the event handler code, and have table initialisaed? you need this to do the search:

      $('#mySearch').keyup( function() {
         table.search($('#mySearch').val()).draw();
      } );
    

    Cheers,

    Colin

This discussion has been closed.