invoke cancel on jeditable
Asked Answered
H

2

10

is there a way to invoke "cancel" on a jeditable area from an external call? (instead of clicking cancel) - basically to close the textarea.

Haughty answered 13/3, 2011 at 15:4 Comment(0)
H
15

It looks like jeditable exposes a method for "cancel" directly on the DOM element that was used to initialize the editable section.

For example:

// A paragraph with jeditable initialized like this:
$('p#editable').editable();

// Could be canceled with:
$('p#editable')[0].reset();

Another option would be to trigger the "click" event on the cancel button itself. In order to do this, we can specify specific html for the cancel button.

$('p#editable').editable({
    cancel: '<button class="cancel_button">cancel</button>'
});

// And to cancel:
$('p#editable').find('.cancel_button').click();
Hughhughes answered 18/3, 2011 at 19:15 Comment(0)
C
0

You can also simply do that:

('.your_jedit_class').each(function(){
    this.reset()
})
Cauliflower answered 27/1, 2014 at 15:58 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.