Value mapping #1935
-
Hi, is there any possibility to map the value before it will be set into the input component? Some api returns boolean values as integer 0/1, when setting these values into a checkbox, it will not work, because integers are not a valid value for the checked property. The other use case would be implicitly converting undefined/null into an empty string for TextBoxes. Using the onChange event of the controller, the value could be converted back, but how can this be done the other way? Here's a code snippet (MUI checkbox)
thx, cheers |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 8 replies
-
i think you will have to build a wrapper around MUI checkbox then, which will accept 1 and 0 as true and false. |
Beta Was this translation helpful? Give feedback.
-
@mbretter: sounds just like my earlier question about transforming the value returned by a controller. |
Beta Was this translation helpful? Give feedback.
i think you will have to build a wrapper around MUI checkbox then, which will accept 1 and 0 as true and false.