views:

246

answers:

1

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?

A: 

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.

wtaniguchi