Tablesorter unable to filter externally on some columns.
Closed this issue · 8 comments
try {
$table = $('#Tblgridinner').tablesorter({
theme: 'blue',
page: 0,
size: 30,
widgets: ["filter", "pager"],
widgetOptions: {
filter_external: '#Txtgridsearchresults',
filter_liveSearch: false,
}
}).tablesorterPager({
container: $(".pager"),
output: '{startRow} - {endRow} / {filteredRows} ({totalRows})',
page: 0,
size: 10
});
}
This is my code.
I have one column with data is like this :1:20:30, this column I am unable to filter from external search input.
Please help me.
Hi @Mottie ,
Thanks for all of your work, very appreciated.
I am experiencing the same/similar issue that Manoj is, and it is even happening in your external search demo page https://mottie.github.io/tablesorter/docs/example-widget-filter-external-inputs.html. Try changing the select box to first or last name, then typing in something.
If I try to filter on a single column instead of 'all', then it throws errors at jquery.tablesorter.widgets.js:1419
Uncaught TypeError: Cannot read property 'eq' of undefinedts.filter.matchType @ jquery.tablesorter.widgets.js:1419ts.filter.processRow @ jquery.tablesorter.widgets.js:1504ts.filter.findRows @ jquery.tablesorter.widgets.js:1759ts.filter.checkFilters @ jquery.tablesorter.widgets.js:1256(anonymous function) @ jquery.tablesorter.widgets.js:1195
Cheers
Hi @jwrichard!
Thanks for that extra bit of info, it helped me find the bug! I will have it fixed here shortly. @Manoj999, please let me know if this fixes your issue.
The fix will be available in the master branch in the widget-filter.js
source file and widget-filter.min.js
dist file for now. I don't have a plan on when the next release will be available.
@Mottie Perfect! I'm excited to see that you were able to fix it. I just tested it out and it is working for me now. Thank you very much 👍
Hi @jwrichard and @Mottie,
Hope you are doing well.
I have that issue previous later I added the property *filter_columnAnymatch:
false *so now I am able to search on all columns.
On Thu, Mar 24, 2016 at 8:33 PM, jwrichard notifications@github.com wrote:
@Mottie https://github.com/Mottie Perfect! I'm excited to see that you
were able to fix it. I just tested it out and it is working for me now.
Thank you very much [image: 👍]—
You are receiving this because you were mentioned.
Reply to this email directly or view it on GitHub
#1177 (comment)
Thanks And Regards,
Manoj.
Hi @jwrichard and @Mottie,
Hope you are doing well.
-
I have that issue previous later I added the property
filter_columnAnymatch: false
so now I am able to search on all columns from external filter. -
On column filtering also I have one issue, I had solved it but I would
like to share with you. issue is,Data on column looks like: On Route To Final Destination,Arrived to
offload Destination e.t.c..In the column filter textbox If I type On route to it is filtering
correctly and If I paste complete text(i.e., On Route To Final Destination)
or
more than On Route to F unable to filter,I thought that it is not
considering spaces correctly.
To solve above issue I used filter_functions option in the following way.
$table = $('#Tblgridinner').tablesorter({
theme: 'blue',
page: 0,
size: 30,
widgets: ["filter", "pager"],
widgetOptions: {
filter_external: '#Txtgridsearchresults',
filter_liveSearch: false,
filter_columnAnyMatch: false,
filter_functions: {
6: function (e, n, f, i, $r, c, data) {
e = e.toLowerCase().replace(/\s/g, "");
f = f.toLowerCase().replace(/\s/g, "");
if (e.indexOf(f) >= 0)
{ return true; }
else { return false; }
},
7: function (e, n, f, i, $r, c, data) {
e = e.toLowerCase().replace(/\s/g, "");
f = f.toLowerCase().replace(/\s/g, "");
if (e.indexOf(f) >= 0)
{ return true; }
else { return false; }
}
}
}
}).tablesorterPager({
container: $(".pager"),
output: '{startRow} - {endRow} / {filteredRows} ({totalRows})',
page: 0,
size: 10
});
I'm guessing this issue has been resolved, so I'm going to close it. If you continue to have problems, please feel free to continue the discussion in this thread.