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

Global filter is not applied when filter on column (filter-column extention) #3015

Closed
nicoden opened this issue Mar 17, 2017 · 1 comment
Closed
Labels
duplicate Issues that are duplicated with other issues. filter-control Issues for the filter-control extension.

Comments

@nicoden
Copy link
Contributor

nicoden commented Mar 17, 2017

When filter with .search text box AND column filter, the result depend on the order we put text in search box.

Type data in column filter the in global search box is ok.

Type data in global search box then in column fllter: Only the column filter is applied

Step to reproduce in this fiddle:

  1. Enter Alice in the global search box
    => Alice displayed, ok
  2. Enter Bob in the Name column filter
    => Bob displayed, not ok, no results should appear in this case

I patched temporarly my code with this:

Pass an null currentTarget to the onSearch event handler in bootstrap-table-filter-control.js:onColumnSearch

this.onSearch({ currentTarget: null });

In the onSearch event handler, use the global search text box if currentTarget is null:

        var text = $.trim($(event.currentTarget || this.$toolbar.find('.search input')).val());

        // trim search input
        if (this.options.trimOnSearch && event.currentTarget && $(event.currentTarget).val() !== text) {

This is not a perfect solution because it break the trimOnSearch for column filter.

@wenzhixin wenzhixin added the filter-control Issues for the filter-control extension. label Mar 17, 2017
@UtechtDustin
Copy link
Collaborator

Duplicate #2776

@UtechtDustin UtechtDustin added the duplicate Issues that are duplicated with other issues. label Apr 4, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
duplicate Issues that are duplicated with other issues. filter-control Issues for the filter-control extension.
Projects
None yet
Development

No branches or pull requests

3 participants