-
Notifications
You must be signed in to change notification settings - Fork 177
onClick event in actions don't seem to work #9
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
Comments
They didn't work before, but they should now. I updated the buttons to use custom onClick actions, if available. This fix is now available on both GitHub and NPM starting in version 0.3.0-alpha.26. I haven't added this option to any other control types yet, but tell me if you need it, and I can easily do so. I tested this as working in the playground, in the set "JSONForm compatibility examples", example "Using event handlers". It strikes me that there should be a more elegant way to handle this in Angular, without putting executable code directly inside a schema - which is why I didn't initially add this feature. However, I don't know what the best alternative would be instead. Also, one of the design goals of this project is backward-compatibility with JSON Form, which includes this feature, so obviously we should support it. Anyway, please test the new version and let me know if it works for you. |
Since I haven't heard back, I'm going to assume this issue is fixed and close it. If you have additional problems, post again and we can re-open it if necessary. Thanks! |
actually, it's not working, you can have a look at the kitchen sink demo, the "Noooooooooooo" button does nothing. |
Any progress on this? |
try this example: |
I couldn't find an example in your library where the onClick event for custom buttons seem to work.
Example:
{
"type": "actions",
"items": [
{
"type": "submit",
"style": "btn-info",
"title": "Do It!"
},
{
"type": "button",
"style": "btn-danger",
"title": "Noooooooooooo",
"onClick": "sayNo()"
}
]
}
The text was updated successfully, but these errors were encountered: