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 does not work for some strings #1486

Closed
spoonerWeb opened this issue Dec 13, 2017 · 5 comments
Closed

Filter does not work for some strings #1486

spoonerWeb opened this issue Dec 13, 2017 · 5 comments

Comments

@spoonerWeb
Copy link

I have a strange behaviour when using the filter for two different strings.
Please have a look at the column "Institution" at https://jsfiddle.net/72ekdkeh/, maybe you can tell me where to look for the bug. Or is it me?

@Mottie
Copy link
Owner

Mottie commented Dec 13, 2017

Hi @spoonerWeb!

The issue appears to be the word "and" inside of Institution name. It's a key word used by the filter widget to combine search queries.

Internally, I tried to bypass it, but it broke a few tests, so I think the easiest solution would be to change the "and" keyword (demo):

$(function() {
  // replace the "and" keyword
  $.tablesorter.language.and = "&&";

  var _table = $("table[data-filterable='data-filterable']");
  _table.tablesorter({
    ignoreCase: false,
    // widget code contained in the jquery.tablesorter.widgets.js file
    widgets: ["filter"],
    widgetOptions: {
      // extra css class name (string or array) added to the filter element (input or select)
      filter_cssFilter: "form-control"
    }
  });
});

I'll take a look at the filter code and make the exact search have priority over the filter type searches. In the mean time, the above word around will fix the problem. Just make sure your users know that they need to use && instead of and to combine filter searches.

@Mottie
Copy link
Owner

Mottie commented Dec 13, 2017

Fixed in v2.29.2... no alteration of the $.tablesorter.language.and value is needed.

@spoonerWeb
Copy link
Author

Thanks a lot for your fast and perfect support! Wish you some nice christmas days.

@spoonerWeb
Copy link
Author

Is there a plan for publishing the 2.29.2 version to npm?

@Mottie
Copy link
Owner

Mottie commented Dec 15, 2017

Oops! Done.

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