filtering - 服务器端过滤中的 Ag-grid setFilter
问题描述
我只想检查是否可以在回调中以复杂对象而不是字符串数组的形式给出 setFilter 值。我们需要 setFilter 来拥有复杂对象的原因是因为我们正在使用服务器端过滤,并且我们希望在过滤器中显示标签,但将密钥发送回服务器以执行过滤。If we have for example objects like {name: 'some name', id: 1} we would like to show 'some name' in filter UI but when that filter is selected we need associated id (in this case 1).
通过查看 setFilter 和相应模型的源代码,似乎这是不可能的。
有没有办法可能我错过了这可以工作?
ag-Grid 版本 23.2.0
解决方案
我有完全相同的问题,从界面看来确实是不可能的,因为string[]
期望值
interface SetFilterValuesFuncParams {
// The function to call with the values to load into the filter once they are ready
success: (values: string[]) => void;
// The column definition object from which the set filter is invoked
colDef: ColDef;
}
推荐阅读
- javascript - Mapbox GL JS:在叠加层上分层道路/城市
- r - 尝试运行 RCyjs 示例时出现 BrowserViz 错误
- postgresql - 在 AWS 中使用 PGAdmin 备份 PostgreSql DB 时出错
- influxdb - InfluxDB:同一查询的响应时间更改
- redux - 更新reducer中嵌套对象的值时如何在spread中使用变量?
- facebook-opengraph - Facebook 无法识别的打开图形属性
- r - mc.cores = 1 的 mclapply() 是否与 lapply() 相同?
- amazon-ec2 - kubernetes 的高磁盘使用率(IOPS 和带宽)
- sqlite - SQLite 中的日期时间转换
- objective-c - presentViewControllerAsSheet OSX 的完成处理程序