11-28-2017 01:25 AM - edited 11-28-2017 01:27 AM
"How to define a FormElement with independent editable state/condition?"
Solved! Go to Solution.
11-28-2017 01:27 AM
All FormElements (FormAction, FormField, FormGroup...) are inheriting the disabled-state of their parent-FormElements. But it is possible to declare FormElements with independent editable-states.
Add a custom-script file to your form, bind a function to the 'form:before:ready' event and set a list with one or more FormElement-ids to the 'itemsWithIndependentEditableState' property.
For example, if you want to define a read-only textfield with a clickable button as child-element.
FormSettings.xml
<Form name="form" customscript="customscript.js"> <FormTab name="tab"> <FormGroup name="group"> <FormField name="textfield" editable="false"> <FormAction name="button" editable="true"></FormAction> </FormField> </FormGroup> </FormTab> </Form>
customscript.js
IG.vent.on('form:before:ready', function (form) { //These formitems don't inherit the editable states of their parents form.itemsWithIndependentEditableState = ['button']; });
11-30-2017 10:08 AM
Thanks
Wolfgang