How can I place the search box within an existing DIV?
How can I place the search box within an existing DIV?
blickbox
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)
This discussion has been closed.
Answers
Your
dom
option will create an element withid=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 tosearch()
.Allan
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?
Have a look at the API reference. In particular
page.len()
.Allan