What is the easiest way to add additional custom values on top of the default values in ag-grid's 'Set' filter? My use case is that I have a table where the data is occasionally changing and values present in a particular column come and go, however if a user is filtered on a particular value then I want to save that selection to be applied in the future if that data is present again.
在AG-GRID的“set”筛选器中,在默认值之上添加额外自定义值的最简单方法是什么?
A real world example is a table showing a Job Scheduler where status is in a set of [RUNNING, SUCCESS, ERROR]. Maybe the user has a filter on RUNNING, however momentarily if there are no jobs running then the default behavior is to not show RUNNING as an option.
一个真实的示例是一个显示作业排定程序的表,其中的状态为[Running,Success,Error]集合。也许用户对运行有一个过滤器,但是如果没有作业正在运行,则默认行为是不将运行显示为一个选项。
I know I probable need to override filterValueGetter, however I'd like to not re-implement the whole Set behavior. Ideally I would keep my own list of selected values from the user and wrap the default behavior to merge user selected values with the values present in the data.
我知道我可能需要覆盖filterValueGetter,但是我不想重新实现整个Set行为。理想情况下,我会保留自己的用户选择值列表,并包装默认行为,将用户选择的值与数据中的值合并。
更多回答
优秀答案推荐
我是一名优秀的程序员,十分优秀!