How can I place the search box within an existing DIV?

How can I place the search box within an existing DIV?

blickboxblickbox Posts: 2Questions: 1Answers: 0

I have trouble understanding the dom option...

I have a div with id="search" and want the search box to appear inside that div.

I though this would do the trick, but it doesn't:
"dom": '<"#search"f>'

What can I do to get the search box and other elements within the div id's of my choosing? And preferably be able to add classes to them so they are styled correctly (bootstrap)

Answers

  • allanallan Posts: 61,740Questions: 1Answers: 10,111 Site admin

    Your dom option will create an element with id=search.

    What you need to do is insert an input element into your existing div and then attach a jQuery event listener to it (keyup for example) that will trigger a call to search().

    Allan

  • blickboxblickbox Posts: 2Questions: 1Answers: 0
    edited January 2015

    Thanks! I got it working now!

    I also want to customize other parts.
    Like the length dropdown list. What would be the equivelent code for that?
    And show the total number of records?

  • allanallan Posts: 61,740Questions: 1Answers: 10,111 Site admin

    Have a look at the API reference. In particular page.len().

    Allan

This discussion has been closed.