vitalets / angular-xeditable

Edit in place for AngularJS
http://vitalets.github.io/angular-xeditable
MIT License
1.91k stars 403 forks source link

onaftersave & onbeforesave not being triggered #404

Open Kreshnik opened 8 years ago

Kreshnik commented 8 years ago

I am having an issue with x-editable, none of the above mentioned events are being triggered after save.

Here are some info that might help solve the issue;

  1. I am using the version 0.1.8 of x-editable, also tested it with version 0.1.9
  2. I am using AngularJS version 1.4.8
  3. The project uses ui-router version 0.2.15
  4. Here is the line of code, which uses x-editable <span><a ui-sref="qa-area({qaId: tree.tree_id})" editable-text="tree.tree_name" e-form="treeForm" onaftersave="qa.updateTreeTitle(tree)"> {{tree.tree_name}} </a></span>

Please let me know, if I can provide more information to this issue.

Kreshnik commented 8 years ago

Just found out that the issue has to do with the method controller. editable-text="tree.tree_name" the tree model in this case belongs to another controller, while onaftersave="qa.updateTreeTitle(tree)" calls a method in another controller. And this seems not to work somehow.

ckosloski commented 8 years ago

Can you provide a jsfiddle or plunker showing your issue?

bokrizan commented 8 years ago

i have similar problem, and fix is, you need to set submit button inside editable-form <form></form>

ckosloski commented 7 years ago

@Kreshnik are you still having an issue?