Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Filter widget - strange behavior in combination with Meteor. #1101

Closed
zorro765 opened this issue Dec 12, 2015 · 2 comments
Closed

Filter widget - strange behavior in combination with Meteor. #1101

zorro765 opened this issue Dec 12, 2015 · 2 comments

Comments

@zorro765
Copy link

Hello there!

I noticed that search strings containing " and " or " or " are not working properly in combination with Meteor.

Let's say a cell contains "Romeo and Julia":
Filter: "Romeo" is working
Filter: "Romeo and" is working
Filter: "Romeo and " is not working
Filter: "Romeo and Julia" is not working

Let's say a cell contains "Romeo or Julia":
Filter: "Romeo" is working
Filter: "Romeo or" is working
Filter: "Romeo or " is not working
Filter: "Romeo or Julia" is not working

Let's say a cell contains "Romeo 123 Julia":
Filter: "Romeo" is working
Filter: "Romeo 123" is working
Filter: "Romeo 123 " is working
Filter: "Romeo 123 Julia" is working

Demo application: http://tablesorter_issue.meteor.com/
The app is using the latest jquery.tablesorter.min.js and widget-filter.min.js.
$(".tablesorter").tablesorter({ theme: 'ice', widgets: ["filter"]})

I can't figure out why it behaves like this, do you have any ideas?

@Mottie
Copy link
Owner

Mottie commented Dec 13, 2015

Hi @zorro765!

This was just discussed in issue #1089 about 24 hours ago.

Basically, " and " and " or " ( both surrounded by spaces) are filter type key words which allow the user to query multiple words or filter types - e.g. "1 and 2", "1 or 2", ">10 and <100", etc.

These key words can be changed by modifying the language.

// change "and" & "or" filter key words to something else
$.tablesorter.language.and = "&&";
// these values are used inside of a new RegExp() so any special characters
// will need to be escaped
$.tablesorter.language.or = "\\|\\|";

@zorro765
Copy link
Author

Oh! Unfortunately, I didn't find it. Thank you very much!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants