码迷,mamicode.com
首页 > 其他好文 > 详细

easyui datagrid datagrid-filter bug

时间:2015-08-26 15:35:11      阅读:168      评论:0      收藏:0      [点我收藏+]

标签:

问题描述:空字符串、数字过滤 过滤异常

修改js源码:

 $.fn.datagrid.defaults.operators = {
        nofilter: {
            text: No Filter
        },
        contains: {
            text: Contains,
            isMatch: function (source, value) {
                return source.toString().toLowerCase().indexOf(value.toLowerCase()) >= 0;// modfy by 253
            }
        },

........

 

   function isMatch(row) {
            var rules = opts.filterRules;
            for (var i = 0; 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

easyui datagrid datagrid-filter bug

标签:

原文地址:http://www.cnblogs.com/bingguang/p/4760265.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!