Closed nikhilarunw closed 7 years ago
I want to disable a field in form conditionally. I am using TextBox component and datatype is string. I have tried setting disable and readOnly props in Entity Schema for a specific field but it is still editable in form.
Entity schema is as follows:
entities: [ { name: "signup", fields: [{ name: "parent_name", displayName: "Parent Name", placeholder: "Parent Name", component: "TextBox", type: "string", error: function(m){ return m.parent_name ? "" : "Please enter a parent name"; }, disabled: function(m){ return m.age > 21 ? false: true; }, readOnly: function(m){ return m.age > 21 ? false: true; } },{ name: "age", displayName: "Age", placeholder: "Age", type: "number" }] } ]
From repository code it looks like disable or readOnly feature has not implemented or Am I missing any configuration ?
For now, disable and readOnly are not implemented. You can use the visible attribute, so you can show this only when you need to show it.
Thank you @JonatanSalas.
@nikhilarunw you are welcome!
I want to disable a field in form conditionally. I am using TextBox component and datatype is string. I have tried setting disable and readOnly props in Entity Schema for a specific field but it is still editable in form.
Entity schema is as follows:
From repository code it looks like disable or readOnly feature has not implemented or Am I missing any configuration ?