Avoid search on element values or attributes

Avoid search on element values or attributes

imacimac Posts: 19Questions: 0Answers: 0
edited March 2013 in General
I've noticed that the search function not only look for the visible content but also on the attributes of the elements in the table.

Here's a living example of it with a checkbox and its value: (search for "demo", or "second")
http://jsfiddle.net/HEDvf/510/

In my case, i have checkboxes in the datable and they have classes, data-types and values. When the user wants to use the search feature, it also look for all those attributes and that's not really what a filter should use.

Example of my checkbox:
[code]

[/code]

Is there any way to avoid this behavior?

Thanks.

Replies

  • allanallan Posts: 63,516Questions: 1Answers: 10,473 Site admin
    That is a bug that was introduced in DataTables 1.9.4 :-(. Discussed here, and a few other places: http://datatables.net/forums/discussion/14112/search-feature-and-links/p1 . The git repo holds a fix, and the link shows the commit if you just want to apply the fix.

    Allan
  • imacimac Posts: 19Questions: 0Answers: 0
    Thanks. I am using right now the 1.0.4 minified version so... i guess i will have to use the complete version to change this lines or otherwise, find the way to minify it again.

    How is it minified? Which method?

    Thanks.
This discussion has been closed.