【发布时间】:2021-02-13 00:32:26
【问题描述】:
根据本网站: enter link description here
我构建了自定义过滤器,但我想将它作为过滤器服务器端。 当请求设置为服务器时,我有来自自定义过滤器的 columnName,但我没有类型:
function whereSql(request) {
debugger;
var whereParts = [];
var filterModel = request.filterModel;
if (filterModel) {
Object.keys(filterModel).forEach(function (key) {
debugger;
var item = filterModel[key];
在这一行中, var item = filterModel[key]; 键未定义,我只能看到使用了我的 TxtCustomFilter 的列名。但类型未定义。
我的自定义过滤器如下所示:
function TxtCustomFilter() {
}
TxtCustomFilter.prototype.init = function (params) {
this.valueGetter = params.valueGetter;
this.setupGui(params);
};
// not called by ag-Grid, just for us to help setup
TxtCustomFilter.prototype.setupGui = function (params) {
this.gui = document.createElement('div');
this.gui.innerHTML =
'<div style="padding: 4px; width: 200px;">' +
// '<div style="font-weight: bold;">Custom Athlete Filter</div>' +
'<div><input style="margin: 4px 0px 4px 0px;" type="text" id="filterText" placeholder="Full name search..."/></div>' +
...
this.filterText = this.gui.querySelector('#filterText');
this.filterText.addEventListener("changed", listener);
this.filterText.addEventListener("paste", listener);
this.filterText.addEventListener("input", listener);
var that = this;
function listener(event) {
debugger;
// that.filterText = event.target.value;
params.filterChangedCallback();
}
【问题讨论】:
标签: angular ag-grid ag-grid-angular