标签:
//扩展 ligerGrid 的 搜索功能(高级自定义查询).应用: demos/filter/grid.htm $.ligerui.controls.Grid.prototype.showFilter = function () { var g = this, p = this.options; if (g.winfilter) { g.winfilter.show(); return; } var filtercontainer = $(‘<div id="‘ + g.id + ‘_filtercontainer"></div>‘).width(380).height(120).hide(); var filter = filtercontainer.ligerFilter({ fields: getFields() }); return g.winfilter = $.ligerDialog.open({ width: 420, height: 208, target: filtercontainer, isResize: true, top: 50, buttons: [ { text: ‘确定‘, onclick: function (item, dialog) { loadData(); dialog.hide(); } }, { text: ‘取消‘, onclick: function (item, dialog) { dialog.hide(); } } ] }); //将grid的columns转换为filter的fields function getFields() { var fields = []; //如果是多表头,那么g.columns为最低级的列 $(g.columns).each(function () { var o = { name: this.name, display: this.display }; var isNumber = this.type == "int" || this.type == "number" || this.type == "float"; var isDate = this.type == "date"; if (isNumber) o.type = "number"; if (isDate) o.type = "date"; if (this.editor) { o.editor = this.editor; } fields.push(o); }); return fields; } function loadData() { var data = filter.getData(); alert(data); } };
需要自己修改
标签:
原文地址:http://www.cnblogs.com/jiecaoge/p/4775348.html