Customizations in Form builder
In my angular 7 application, i included the "angular-formio": "3.17.0" and "formiojs": "3.21.5" npm packages. Now builder is rendering well but questions is - how to do customizations to it.
<form-builder [form]="formDefinition">
in component, I set value something like below, this.formDefinition = {"components": [{ "input": true, "inputType": "checkbox", "tableView": true, "hideLabel": false, "label": "Add a new charity", "key": "IsNewCharity", "defaultValue": false, "protected": false, "persistent": true, "validate": { "required": false }, "type": "checkbox", "tags": [], "conditional": { "show": "", "when": null, "eq": "" }, "lockKey": true, "datagridLabel": true, "clearOnHide": true, "autofocus": false, "dataGridLabel": false, "hidden": false, "name": "", "value": "", "labelPosition": "right", "properties": {} }}
Builder is rendering well.
Now question is how to do customization to it. Example
- How to hide components Ex - i need to hide File component from builder
- How to change Section heading, ex- rename 'basic components' to 'Level 1 components'
Can we move component from 1 section to another? if so, how? Please provide links to follow..
@Theaggarwal for hiding the components, you have to set options and set the custom builder json like this
In .html: <form-builder [form]="form" [options]="builder">
In .ts file:
public builder: Object = {
builder: {
premium: { components: { file: false}}
//set file to false to hide file component inside premium section
}
};
Thanks a lot @muthuML it works... but with a little change.. ( advanced instead of premium)
public formBuilderConfig: any = { builder: { advanced: { components: { file: false } } } };
Does anyone know how to change Section heading, ex- rename 'basic components' to 'Level 1 components' ??
Thanks all.. get the solution of my above question as well.. using above fix and https://formio.github.io/formio.js/app/examples/custombuilder.html
