Custom Component Template
Hi,
I am working on a custom component and have the following questions
- Is it possible to have template config like angularjs when creating custom components in pure JS?
- How do i bind events from defaults components, like textfield to do custom logic? (I have a "multiple" checkbox, which when selected does not work as a normal component functionality)
Any help would be really appreciated.
Thanks
Hello,
The 4.x branch of this library does support templates much like you would see in the Angular JS renderer, but that is currently in an alpha state and not ready to be released in production. You can bind to specific components by first grabbing the component from the renderer, and then calling the "on" method on that component.
var component = formio.getComponent('firstName'); component.on('componentChange', () => { console.log('component changed'); });
Hope this helped you.
Thanks!
Thanks.
When creating is custom component, do we need any other config to enable "multiple" option to work? The code that I have, with the multiple option checked, does not show the "add item" button for a custom component.
Hello,
This is Jeriah from the Form.io support team.
The multiple setting should work without adding any other configs as long as you do not override any of the methods that are used to build the component. We will need to get on a debugging session with you looking at your code to determine what is wrong. Please let us know if you are interested in our support package pricing. Thank you!