正文
easyui datagrid datagrid-filter bug
小程序:扫一扫查出行
【扫一扫了解最新限行尾号】
复制小程序
【扫一扫了解最新限行尾号】
复制小程序
问题描述:空字符串、数字过滤 过滤异常
修改js源码:
$.fn.datagrid.defaults.operators = {
nofilter: {
text: 'No Filter'
},
contains: {
text: 'Contains',
isMatch: function (source, value) {
return source.toString().toLowerCase().indexOf(value.toLowerCase()) >= ;// modfy by 253
}
},
........
function isMatch(row) {
var rules = opts.filterRules;
for (var i = ; i < rules.length; i++) {
var rule = rules[i];
var source = row[rule.field];
if (source || source == "" || typeof ( source)=="number ") {// modfy by 253
var op = opts.operators[rule.op];
if (!op.isMatch(source, rule.value)) {
return false;
}
}
}
return true;
}
....
摘自:http://my.oschina.net/gofan/blog/208535