如何解决Ag 网格企业服务器端自定义过滤器不起作用
我使用的是企业版 AgGrid。并希望在网格上应用自定义过滤器。 如何将选择单选框值设置为网格元数据? 参考代码如下:
cat <script_name> | grep -e 'bash' -e 'source' -e '\.\/'
// 自定义过滤器
gridOptions={
....
columnDef : [{
headerName : "Last Updated",field : "lastUpdated",width:columnWidth(gridElementname,9),filter : *DateFilter,cellRenderer : '*CellRenderer',},...];
rowModelType: 'serverSide',}
也实现了外部过滤器,但这种方法在这里没有帮助。
function *DateFilter() {
}
*DateFilter.prototype.init = function(params) {
this.eGui = document.createElement('div');
this.eGui.innerHTML =`
<input type="radio" name="timeFilter" id="dateToday" value = "1"><label>Added Today</label><br>
<input type="radio" name="timeFilter" id="datePast7" value = "2"><label> Past 7 days</label><br>
`;
this.dateToday = this.eGui.querySelector('#dateToday');
this.datePast7 = this.eGui.querySelector('#datePast7');
this.dateToday.addEventListener('change',this.onRbChanged.bind(this));
this.datePast7.addEventListener('change',this.onRbChanged.bind(this));
this.filterActive = false;
this.filterChangedCallback = params.filterChangedCallback;
this.valueGetter = params.valueGetter;
};
*DateFilter.prototype.getGui = function() {
return this.eGui;
};
*DateFilter.prototype.onRbChanged = function() {
this.dateToday.filterActive = this.dateToday.checked;
this.datePast7.filterActive = this.datePast7.checked;
this.filterChangedCallback();
};
*DateFilter.prototype.isFilterActive = function() {
if(this.dateToday.filterActive == true)
return this.dateToday.filterActive;
else if(this.datePast7.filterActive == true)
return this.datePast7.filterActive;
};
*DateFilter.prototype.doesFilterPass = function(params) {
return true;
};
*DateFilter.prototype.getModel = function() {
};
*DateFilter.prototype.setModel = function() {
};
提前致谢。 :)
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。