Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Discussion options

You must be logged in to vote

Here's a small example using RQB v7. You can do the same thing in v6, but it's more convoluted.

https://codesandbox.io/p/devbox/hzwyhd?file=%2Fsrc%2FApp.tsx

This example guarantees a rule in the first position by conditionally hiding the "remove rule" button. It implements a custom field selector that displays only the "Is a..." options for the first rule, and only those that are in the same group (a custom field property) for all other rules.

To enforce the "group" constraint on all rules, I made it where the query would just get wiped out if the user changes the value of the first rule. Probably not what you want, but I'd need to know more about the business logic to properly cover that…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@A-EbrahimRSA
Comment options

Answer selected by A-EbrahimRSA
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants