Skip to content

Table filter control when pagination on server submit response twice #1501

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

Closed
javieralfaya opened this issue Oct 4, 2015 · 4 comments
Closed
Labels
awaiting reply Issues that are awaiting reply, will be closed if there is no any response in 7 days. extension Issues for adding or updating our extension.

Comments

@javieralfaya
Copy link

Table filter control when pagination on server submit response twice, i commented this.update Pagination(); into bootstrap-table-filter-control.js and problem is resolved:

BootstrapTable.prototype.onColumnSearch = function (event) {
    copyValues(this);
    var text = $.trim($(event.currentTarget).val());
    var $field = $(event.currentTarget).parent().parent().parent().data('field')

    if ($.isEmptyObject(this.filterColumnsPartial)) {
        this.filterColumnsPartial = {};
    }
    if (text) {
        this.filterColumnsPartial[$field] = text;
    } else {
        delete this.filterColumnsPartial[$field];
    }

    this.options.pageNumber = 1;
    this.onSearch(event);

    //this.updatePagination();
    this.trigger('column-search', $field, text);
};
@wenzhixin
Copy link
Owner

Can you provide a jsfiddle to show the problem and create a new pull request?

@javieralfaya javieralfaya reopened this Oct 7, 2015
@wenzhixin wenzhixin added extension Issues for adding or updating our extension. awaiting reply Issues that are awaiting reply, will be closed if there is no any response in 7 days. labels Oct 9, 2015
@djhvscf
Copy link
Collaborator

djhvscf commented Nov 23, 2015

Same as #1605 , close this issue

@djhvscf djhvscf closed this as completed Nov 23, 2015
@cyberbobjr
Copy link

I confirm the bug and the workaround provided (comment the this.updatePagination();)
regards.

@tigris
Copy link

tigris commented Apr 13, 2016

Is commenting out a line of the code really the solution? I'm seeing this same problem. What is the line of code doing then if we are all to just comment it out?

I'm using the bootstrap-table-rails rubygem, so commenting out a line of code in the vendored assets is not an easy task. So to "fix" the problem in this manner I would need to manually vendor this particular extension and keep it up to date myself with future fixes. Less than ideal.

Is the problem related to combining filter-control with server side pagination? If so, can't a better fix be to wrap that line of code in a simple if block rather than comment it out?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
awaiting reply Issues that are awaiting reply, will be closed if there is no any response in 7 days. extension Issues for adding or updating our extension.
Projects
None yet
Development

No branches or pull requests

5 participants