ColumnFilterWidgets
ColumnFilterWidgets copied to clipboard
Filter fails when table cells have interior wrapper
< td >value< /td > < /code > works just fine for filtering value.
For some reason < td >< span >value< /span >< /td >
shows up in the filters list but when selected it shows an empty result set.
I couldn't quite figure out how to do the code markdown in github.
I just noticed this as well. ColumnFilterWidgets doesn't handle HTML markup in cells. I'm thinking an option to do a sloppier match that would just look for a term anywhere in the cell content might be good enough for most scenarios.
Same problem here. Using cells with hiperlinks. The filters fills ok, but when I select one to to filter it fails.
A little more testing indicates that the failure only happens when the sSeparator option is used. Let me know if you have a test case where that's not true.
Found this to be the case with sSeparator option.
the list gets created, but the values of each option element are filled with the markup surrounding your text even if you tell datatables sType is HTML. Regardless of using the sSeparator or not, a filter on a column with markup fails.
Hi guys, i tried to use column filter widget to work with tables with html links, where i have same text but diferent ID in hyperlink. I manage to add sValue = sValue.replace(/(<.*?>)/ig,"");
on 59 line (filling asResultData array loop) so in dropdown box are datas without html. This solves problem for me, hope it helps. (but i dont know how jquery works, so its advice from mere nOOb)
Seeing the same problem.... my cells contain hyperlinks separated by commas. Filtering works fine, but the option tags contain the link HTML as well as the text. When using those filters, it returns blank results each time.
I tried Muhahe's fix above but it didn't work... Any ideas? Thanks so much!
The fix for this is to change line 57 of ColumnFilterWidgets.js (v 1.0.3) to:
var sValue = $('<div>' + this.fnGetData(iRow, iColumn) + '</div>').text();
Thanks to Alexs6 for this: http://datatables.net/forums/discussion/comment/41317#Comment_41317
Alexs6's solution causes a new problem where values that have an entity such as & in them no longer work. The HTML examples have one of these in the Platform(s) widget, "Win 95+ (Entity: &)", and there is a unit test case. I'd like to find a fix that handles both cases.
I've had to move over to a different plugin to get this feature working, maybe there's code in that that could help here. I'm not a jQuery pro so I'm not sure what/how to go about it, but this is the other plugin: https://github.com/vedmack/yadcf