|
@@ -586,10 +586,10 @@
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
var that = this;
|
|
var that = this;
|
|
|
- var fp = $.isEmptyObject(this.filterColumnsPartial) ? null : this.filterColumnsPartial;
|
|
|
|
|
|
|
+ var fp = $.isEmptyObject(that.filterColumnsPartial) ? null : that.filterColumnsPartial;
|
|
|
|
|
|
|
|
//Check partial column filter
|
|
//Check partial column filter
|
|
|
- this.data = fp ? $.grep(this.data, function (item, i) {
|
|
|
|
|
|
|
+ that.data = fp ? $.grep(that.data, function (item, i) {
|
|
|
for (var key in fp) {
|
|
for (var key in fp) {
|
|
|
var thisColumn = that.columns[that.fieldsColumnsIndex[key]];
|
|
var thisColumn = that.columns[that.fieldsColumnsIndex[key]];
|
|
|
var fval = fp[key].toLowerCase();
|
|
var fval = fp[key].toLowerCase();
|
|
@@ -602,28 +602,27 @@
|
|
|
[value, item, i], value);
|
|
[value, item, i], value);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- if (thisColumn.filterStrictSearch) {
|
|
|
|
|
- if (!($.inArray(key, that.header.fields) !== -1 &&
|
|
|
|
|
- (typeof value === 'string' || typeof value === 'number') &&
|
|
|
|
|
- value.toString().toLowerCase() === fval.toString().toLowerCase())) {
|
|
|
|
|
- return false;
|
|
|
|
|
- }
|
|
|
|
|
- } else if (thisColumn.filterStartsWithSearch) {
|
|
|
|
|
- if (!($.inArray(key, that.header.fields) !== -1 &&
|
|
|
|
|
- (typeof value === 'string' || typeof value === 'number') &&
|
|
|
|
|
- (value + '').toLowerCase().indexOf(fval) === 0)) {
|
|
|
|
|
- return false;
|
|
|
|
|
- }
|
|
|
|
|
- } else {
|
|
|
|
|
- if (!($.inArray(key, that.header.fields) !== -1 &&
|
|
|
|
|
- (typeof value === 'string' || typeof value === 'number') &&
|
|
|
|
|
- (value + '').toLowerCase().indexOf(fval) !== -1)) {
|
|
|
|
|
- return false;
|
|
|
|
|
|
|
+ if($.inArray(key, that.header.fields) !== -1 ) {
|
|
|
|
|
+ if(typeof value === 'string' || typeof value === 'number') {
|
|
|
|
|
+ if (thisColumn.filterStrictSearch) {
|
|
|
|
|
+ if(value.toString().toLowerCase() === fval.toString().toLowerCase()) {
|
|
|
|
|
+ return true;
|
|
|
|
|
+ }
|
|
|
|
|
+ } else if (thisColumn.filterStartsWithSearch) {
|
|
|
|
|
+ if((value + '').toLowerCase().indexOf(fval) === 0) {
|
|
|
|
|
+ return true;
|
|
|
|
|
+ }
|
|
|
|
|
+ } else {
|
|
|
|
|
+ if((value + '').toLowerCase().indexOf(fval) !== -1) {
|
|
|
|
|
+ return true;
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
- return true;
|
|
|
|
|
- }) : this.data;
|
|
|
|
|
|
|
+
|
|
|
|
|
+ return false;
|
|
|
|
|
+ }) : that.data;
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
BootstrapTable.prototype.initColumnSearch = function(filterColumnsDefaults) {
|
|
BootstrapTable.prototype.initColumnSearch = function(filterColumnsDefaults) {
|