|
@@ -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('<div class="columns-%s pull-%s" style="margin-top:10px;margin-bottom:10px;">', this.options.buttonsAlign, this.options.buttonsAlign));
|
|
|
- html.push(sprintf('<button class="btn btn-default%s' + '" type="button" name="commonSearch" title="%s">', that.options.iconSize === undefined ? '' : ' btn-' + that.options.iconSize, that.options.formatCommonSearch()));
|
|
|
- html.push(sprintf('<i class="%s %s"></i>', that.options.iconsPrefix, that.options.icons.commonSearchIcon))
|
|
|
+ html.push(sprintf('<button class="btn btn-default btn-commonsearch %s' + '" type="button" name="commonSearch" title="%s">', that.options.iconSize === undefined ? '' : ' btn-' + that.options.iconSize, that.options.formatCommonSearch()));
|
|
|
+ if (that.options.searchCountTips) {
|
|
|
+ html.push(sprintf('<span class="label label-danger hidden">0</span>'));
|
|
|
+ }
|
|
|
+ html.push(sprintf('<i class="%s %s"></i>', that.options.iconsPrefix, that.options.icons.commonSearchIcon));
|
|
|
html.push('</button></div>');
|
|
|
}
|
|
|
if (that.$toolbar.find(".pull-right").length > 0) {
|