有没有办法从外部调用中调用jeditable区域上的"cancel“?(而不是单击cancel) -基本上是关闭文本区。
发布于 2011-03-19 03:15:06
看起来jeditable直接在用于初始化可编辑部分的DOM元素上公开了一个用于“取消”的方法。
例如:
// A paragraph with jeditable initialized like this:
$('p#editable').editable();
// Could be canceled with:
$('p#editable')[0].reset();另一种选择是在cancel按钮本身触发"click“事件。为此,我们可以为cancel按钮指定特定的html。
$('p#editable').editable({
cancel: '<button class="cancel_button">cancel</button>'
});
// And to cancel:
$('p#editable').find('.cancel_button').click();发布于 2014-01-27 23:58:14
您也可以简单地这样做:
('.your_jedit_class').each(function(){
this.reset()
})https://stackoverflow.com/questions/5290191
复制相似问题