Custom filter menu via bootstrap dropdown!!!
Custom filter menu via bootstrap dropdown!!!
kunalvirk
Posts: 4Questions: 2Answers: 0
Hi there,
I'm creating a dynamic jQuery table that get its data via JSON, though right now it is static. I want to add custom filter dropdown menu (using bootstrap) with three options i.e. Search, Sort Ascending, Sort Descending.
I've created this https://jsfiddle.net/kunalvirk/jaud6hup/.
Nothing is working right now, as my TDs contains a HTML structure. Can anyone please help me here...!!!
Thanks in advance.
This question has an accepted answers - jump to answer
This discussion has been closed.
Answers
A number of issues I've spotted here.
1)
ordering
is disabled, so you won't ever be able to order the table!2)
sort()
will not sort the table. As it's documentation says:3) You need to redraw the table after an order action.
https://jsfiddle.net/jaud6hup/4/
Allan
Thank you very much allan . But how can I make the search input to look into the HTML of columns TD.???
You'd need to call the
column().search()
and then thedraw()
method, just like you already have done for the footer input elements (although there aren't any there - it looks like some copy / paste code).Allan