Skip to content

Commit

Permalink
Merge pull request wenzhixin#3077 from jvdmr/timeout-per-column
Browse files Browse the repository at this point in the history
keep timeout per column, not globally
  • Loading branch information
wenzhixin authored Dec 14, 2017
2 parents 7eb44ab + 950c2b0 commit 4e5fe1f
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions src/extensions/filter-control/bootstrap-table-filter-control.js
Original file line number Diff line number Diff line change
Expand Up @@ -231,8 +231,7 @@
var createControls = function (that, header) {
var addedFilterControl = false,
isVisible,
html,
timeoutId = 0;
html;

$.each(that.columns, function (i, column) {
isVisible = 'hidden';
Expand Down Expand Up @@ -319,8 +318,8 @@
return;
}

clearTimeout(timeoutId);
timeoutId = setTimeout(function () {
clearTimeout(event.currentTarget.timeoutId || 0);
event.currentTarget.timeoutId = setTimeout(function () {
that.onColumnSearch(event);
}, that.options.searchTimeOut);
});
Expand All @@ -334,8 +333,8 @@
return;
}

clearTimeout(timeoutId);
timeoutId = setTimeout(function () {
clearTimeout(event.currentTarget.timeoutId || 0);
event.currentTarget.timeoutId = setTimeout(function () {
that.onColumnSearch(event);
}, that.options.searchTimeOut);
});
Expand All @@ -352,8 +351,8 @@
var newValue = $input.val();

if (newValue === "") {
clearTimeout(timeoutId);
timeoutId = setTimeout(function () {
clearTimeout(event.currentTarget.timeoutId || 0);
event.currentTarget.timeoutId = setTimeout(function () {
that.onColumnSearch(event);
}, that.options.searchTimeOut);
}
Expand Down

0 comments on commit 4e5fe1f

Please sign in to comment.