diff --git a/public/assets/js/bootstrap-table-commonsearch.js b/public/assets/js/bootstrap-table-commonsearch.js index 6a6fe270..8091961c 100644 --- a/public/assets/js/bootstrap-table-commonsearch.js +++ b/public/assets/js/bootstrap-table-commonsearch.js @@ -43,7 +43,7 @@ setTimeout(function () { that.onCommonSearch(); - }, 0); + }, 10); }); }; @@ -208,13 +208,23 @@ } else { value = process ? process(obj.val()) : obj.val(); } - if (removeempty && (value == '' || value == null || ($.isArray(value) && value.length == 0)) && !sym.match(/null/i)) { + if (removeempty && (value === '' || value == null || ($.isArray(value) && value.length === 0)) && !sym.match(/null/i)) { return true; } op[name] = sym; filter[name] = value; }); + if (that.options.searchCountTips) { + var count = 0; + $.each(filter, function (key, value) { + if ((value === '' || value == null || ($.isArray(value) && value.length === 0))) { + return true; + } + count++; + }); + that.$toolbar.find(".btn-commonsearch > span").text(count).toggleClass("hidden", count === 0); + } return {op: op, filter: filter}; }; @@ -244,6 +254,7 @@ actionForm: "", searchFormTemplate: "", searchFormVisible: true, + searchCountTips: true, searchClass: 'searchit', showSearch: true, renderDefault: true, @@ -268,7 +279,7 @@ return "Common search"; }, formatCommonSubmitButton: function () { - return "Submit"; + return "Search"; }, formatCommonResetButton: function () { return "Reset"; @@ -311,8 +322,11 @@ html = []; if (that.options.showSearch) { html.push(sprintf('