首页 > 代码库 > js过滤

js过滤

datagrid:
                loadFilter: function (data) {
                    return loadFilter(data);    //自定义过滤方法         
                },            


//自定义过滤方法
            function loadFilter(data) {
                for (var i = 0; i < data.rows.length; i++) {
                    for (var att in data.rows[i]) {
                        if (typeof (data.rows[i][att]) == "string") {
                            //data.rows[i][att] = data.rows[i][att].replace(/</g, "&lt;").replace(/>/g, "&gt;");
                            data.rows[i][att] = unescape(data.rows[i][att]);
                        }
                    }
                }
                return data;
            }

js过滤