json-forms
json-forms copied to clipboard
Poperly disable all inputs for readonly properties
http://brutusin.org/json-forms/#12
I originally thought it would only be necessary for primitives and arrays, because an object could just have its members marked as read only, but now I see some use cases where it is in fact the object that should be marked as such. Working on a patch.
What does properly disabling read only inputs look like? Especially for non-bootstrap components.
For bootstrap, there's the static controls.
https://v4-alpha.getbootstrap.com/components/forms/#static-controls
My first impression was that "bar" and "corge" inputs should be disabled too , but maybe this is not right, given that the type of the array item can also be mark as readonly. So I can't see the issue now.
Maybe @ocschwar can give us more info.
Hi, all. Sorry I've vanished into the ether the last few months. My feeling is that the "readOnly" attribute should be inherited. So if the root of the schema starts with "false", every element is writeable until you hit an element that is set to "true." Then, the descendants are marked as disabled, until you hit an element where it's set to false. And so on and so forth.
makes sense... but why rendering this tree at all?
It lets you set whether an object should have attributes added or removed, and whether an array should be added to or subtracted from.