在使用textMatcher时,需要将其与filterParams中的textCustomComparator一起使用才能有效地执行过滤。示例代码如下:
filterParams: {
textCustomComparator: function (filter, value, filterText) {
// 自定义比较逻辑,返回 true 或 false
}
},
filter: 'agTextColumnFilter',
filterParams: {
textMatcher: function (filterValue, cellValue) {
// 根据 textCustomComparator 的返回值来执行过滤
return true; // 或者返回false
}
}