-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Event for add option #1098
Comments
From what I can tell after poking through the source there do not seem to be any events fired when adding or removing options. However, it's possible to workaround this using a MutationObserver which essentially watches the options DOM tree for additions or removals, basically accomplishing the same thing. The following is something I implemented recently and should give you a general idea of how to go about it. The function can be used as the handler for the for the onadd typeUserEvent in the form builder, see https://formbuilder.online/docs/formBuilder/options/typeUserEvents/ Also worth noting the formBuilderRendered event in the code below is a custom event that I dispatch in my application after the formBuilder promise completes, so you may need to remove that.
|
allows you to define an onAddOption method that will transfer the optionTemplate to add custom label or values. resolves #1098
# [3.5.0](v3.4.5...v3.5.0) (2020-08-23) ### Features * onAddOption ([7824e08](7824e08)), closes [#1098](#1098)
🎉 This issue has been resolved in version 3.5.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
Description:
Is there any event fired that I can catch and modify data before returning when user clicks on Add Option (Something like onAddField in formBuilder)
I would like to use this to autogenerate Value.
I tried to search in docs but could not find anything related.
Environment Details:
Expected Behavior
Actual Behavior
Steps to Reproduce
Screenshot - (optional)
The text was updated successfully, but these errors were encountered: