Scriptaculous Ajax.InPlaceEditor: How to trigger cancel action?

581 Views Asked by At

Certainly it must be possible to fire the cancel action on an Ajax.InPlaceEditor without clicking the Cancel button. But I just cannot figure out how to do it.

Any suggestions?

1

There are 1 best solutions below

0
wtaniguchi On

Just went though scriptaculous source, and found it:

  • When you hit cancel, it triggers handleFormCancellation, that triggers wrapUp, that triggers leaveEditMode and onComplete callback.

Thing is, wrapUp is defined as:

 wrapUp: function(transport)

so you can pass null as transport when calling it.

leaveEditMode is parameter-less so, you don't need to worry about null values in callbacks. Although, guess any of this two should work.