menu
announcement

Spectrum is now read-only. Learn more about the decision in our official announcement.

JSONForms

JSON Forms is a JSON Schema based approach for creating forms and comes with support for React, Angular and Vue. Support here is free, but might involve some delay in the replies based on our current workload for paying customers. We also offer PROFESSIONAL SUPPORT packages to get you started quickly with JSON Forms and to help you with any questions and technical difficulties for JSON Forms with guaranteed response time and in-depth technical solutions. For details please see our web page linked below.

Channels
Team

Condition to the multiselect

September 30, 2020 at 3:24pm

Condition to the multiselect

September 30, 2020 at 3:24pm
Hello Team, I have implemented a custom renderer for multiselect using array. I would like to add a condition to one of the object in the array. Like, if an item 5 is selected in the array then I want to enable another field in the form. I did try using the "effect: show" and "expected value" for the condition but it is only working for dropdown but not to the array of multiselect. Any suggestions over here?

September 30, 2020 at 3:34pm
Hi (narayan2627), if I understand correctly the element which is not working is your custom element right? You need to make sure to enable/disable and show/hide your element based on the props you receive from JSON Forms, then it should work. You can check how the provided renderers are implemented to implement this behavior.
In React material we mostly use a Hidden element around the output and handing over disabled flags to Material UI components. See MaterialDateControl for an example.