Individual Column Searching with inputs in headers 1.10.2

Individual Column Searching with inputs in headers 1.10.2

dmurphdmurph Posts: 2Questions: 1Answers: 0

Does anyone have a working example of individual column filters with the input fields in the headers? I tried to use the comments from the example page (https://datatables.net/examples/api/multi_filter.html) to get it working but couldn't quite get it all the way there.

Here is a jsfiddle that visibly looks correct but doesn't actually do the filtering when you type within the column search inputs. Everything else seems to be working...
http://jsfiddle.net/dmurph/80umxrxe/1/

Here is a jsfiddle of it all working, but it relies on having to add a class to one of the header rows (hoping that isn't needed)...
http://jsfiddle.net/80umxrxe/6/

Thoughts?

Answers

  • hhmhhm Posts: 24Questions: 3Answers: 2

    Your first fiddle doesn't work because you declare <thead> twice in the HTML.

  • daniel_rdaniel_r Posts: 460Questions: 4Answers: 67

    @dmurph , you can take a look at my yadcf plugin for datatables http://yadcf-showcase.appspot.com/

  • dmurphdmurph Posts: 2Questions: 1Answers: 0

    @hhm - I don't think that is an issue. Look at the 2nd jsfiddle - it also has two heads, but one is used as the filter. My example just requires having a class on the 2nd head to designate it as the filter row. There is just too much custom javascript and HTML for my liking when compared to having the filters in the footer (which is just adding it to the dom attribute when initializing dataTables).

    Does anyone have a better way of making filters in the header instead of the footer of the table? I wish this was just an option within dataTables. Here is an example of what I am talking about...
    http://jsfiddle.net/dmurph/b71jtjf1/

    Thanks in advance.
    Dan

This discussion has been closed.