Skip to content
This repository was archived by the owner on Sep 8, 2020. It is now read-only.

Passing a call back function save_onsavecallback is not triggered when save button is clicked #260

Open
davidsekar opened this issue May 29, 2016 · 5 comments

Comments

@davidsekar
Copy link

I'm trying to set callback save_onsavecallback for the save plugin. But it looks like it is not at all registered as a callback through the init options.

I expected to see $scope is not defined or some error. but It did nothing. There is something else that I'm missing while sending the callback function,

I have posted a query in SO if someone has done similar thing with the save plugin
http://stackoverflow.com/questions/37512082/angular-directive-how-to-trigger-a-save-method-in-the-controller-whentinymce-s

Kindly let me know if you want me to share some additional code snippet

@lucasgranberg
Copy link
Contributor

Do you have the save plugin enabled? I don't think it is by default.

@davidsekar
Copy link
Author

Yes I'm pretty sure. That I have included "save" plugin in the list of plugins and the Save icon appeared in the toolbar as expected. but the callback method isn't triggered as expected.

may be I will create a plunker for submitting over here for investigation

@davidsekar
Copy link
Author

Here is the sample setup, how i use in my project. https://plnkr.co/edit/tFCIqWTet7009kvPVdln?p=preview

@davidsekar
Copy link
Author

This seems to be the issue :
when save_enablewhendirty is set as true (default), the callback is not trigged at all.
When this option is set to false. Everything seems to work fine. (A StackOverflow user has identified that it is working when set to false. Never occurred to me, as i just didn't want to modify the default value )

Cause : Even though the content with TinyMCE is changed. It says that the control is still untouched.
ng-untouched ng-valid ng-not-empty ng-dirty ng-valid-parse

@ershwetabansal
Copy link

Hey Dan, I was facing the same issue with ui-tinymce where save callback is not getting called. I have created a PR along with tests to fix the issue. Could you please check the same and merge it if you find it okay.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants