Dynamic valueEditors based on operators for a field #571
Replies: 6 comments 27 replies
-
This should get you pointed in the right direction: https://react-querybuilder.js.org/docs/tips/custom-with-fallback |
Beta Was this translation helpful? Give feedback.
-
|
Beta Was this translation helpful? Give feedback.
-
Hey @jakeboone02, thank you for the reply, I think what @muddana-harini is trying to tell is when we change the field type based on operator, like we change from textbox to select box the value "dropdown" is not automatically applied in value field. I changed the code and added it here If we have select option as default one then its picking the value try changing
to
you can see when its default select for inputtype it picks first option as value but when we change it default to text and then change the operator to pick select it doesn't pick value even when you click in that first option (you have to click other option to make change detection work) just check the query value https://codesandbox.io/p/devbox/relaxed-shape-yhftfh?file=%2Fsrc%2FApp.tsx%3A68%2C47 |
Beta Was this translation helpful? Give feedback.
-
Hey Jake, const getOperators = (fieldName) => { json file---> |
Beta Was this translation helpful? Give feedback.
-
Hey Jake,
Hoping to hear from you soon. https://codesandbox.io/p/sandbox/adoring-lovelace-tsxfks?file=%2Fsrc%2FApp.js |
Beta Was this translation helpful? Give feedback.
-
for 2nd solution --> |
Beta Was this translation helpful? Give feedback.
-
Is there a way to get different value editors like dropdown or textbox dynamically based on the selected operator for a field?? If yes, how?
Beta Was this translation helpful? Give feedback.
All reactions