Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Does this library support calculation operator such as + - * / #596

Open
kellywang1234 opened this issue Nov 16, 2023 · 1 comment
Open

Comments

@kellywang1234
Copy link

kellywang1234 commented Nov 16, 2023

Really helpful library! i am using it now. More implementation comes, I am wondering if querybuilder library support more complex calculation operator such as multiple, divide, plus, minus?
For example i want to implement a rule/condition where it can be:

First Value Field * Second Value Field = 2

Is it possible to realize?
Thank you!

@kellywang1234 kellywang1234 changed the title Does this library support calculation operator such as + - * / ? Does this library support calculation operator such as + - * / Nov 16, 2023
@jakeboone02
Copy link
Member

Thanks for the kind words! I've been considering adding a "function" value type for a while, which might cover the +/-/*// use cases as well.

In the meantime, you can do something like what I implemented in my day job which is to encode the expression in the rule value as a plain string, then parse it from the props during render and then reconstruct the string in the correct format when you call props.handleOnChange().

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants