Trying to add custom operator similar to notNull #220
-
I am looking to add two new operators for 'is true' and 'is false' where like 'notNull' and 'null' the value field is hidden. How would I go about doing this? It seems like those two cases are specifically somewhere in the codebase. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
There are a couple of ways to do it. The demo code shows how to create a field with The other way is to do it as you describe, with the operators I've set up this codesandbox to demonstrate both techniques. Field 1 is configured to use the default components, Field 2 uses custom |
Beta Was this translation helpful? Give feedback.
There are a couple of ways to do it. The demo code shows how to create a field with
"is"
as the only operator and a checkbox as the value component (seevalueEditorType: 'checkbox'
). In that case, checked =true
and unchecked =false
. This method uses the defaultValueEditor
component so there's minimal configuration necessary.The other way is to do it as you describe, with the operators
"is true"
and"is false"
but no value editor. That way is a little more complicated. You'll need to set up a customValueEditor
component that returnsnull
for those specific operators. If you're using theformatQuery
method, you'll also need to set up a customvalueProcessor
function to take care of the…