Quantcast
Channel: Recent Discussions — DataTables forums
Viewing all articles
Browse latest Browse all 82803

Searching on table with some data-search unreliable

$
0
0

Link to test case: [1] https://live.datatables.net/fedepigo/1/edit [2] https://live.datatables.net/yuwaramu/1/edit
Debugger code (debug.datatables.net): N/A
Error messages shown: N/A
Description of problem:
Adding the data-search attribute only in some cells makes the table's search behave, at the very least, unintuitively.

On the first test case, I have added a data-search attribute on the second row, in one of the cells. It doesn't seem to work, as searching "Madrid" doesn't yield any results. Every other search term works, however. I can search names, positions, etc. with no issues. I can even find the cell I added said attribute, just not by that.

On the second test case, the row with the data-search is the first row. It lets me search for Madrid now, but... now it breaks searching for the position of any other rows. Other fields are fine.

Seems like the first row dictates whether data-search will be allowed or not in the rest of the column.
It also seems like having data-search 'allowed' in said column ([2]) will not result in non-attributed cells resorting back on their value.

Admittedly, this does appear in the documentation's comments back since 1.11 ( https://datatables.net/examples/advanced_init/html5-data-attributes.html#Comments ), but it doesn't seem like intended behaviour. If it is so, maybe it should be added to the main documentation.

(Bonus question: Should a cell with a data-search attribute ONLY return results with said attribute, or should it search in BOTH the attribute AND the cell's value?)


Viewing all articles
Browse latest Browse all 82803

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>