在jeditable上调用取消 [英] invoke cancel on jeditable

查看:81
本文介绍了在jeditable上调用取消的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有没有办法在外部呼叫的可调整区域上调用取消? (而不是单击取消) - 基本上关闭textarea。

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

推荐答案

看起来像jeditable直接公开取消的方法在用于初始化可编辑部分的DOM元素上。

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

例如:

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

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

另一种选择是触发取消按钮本身的点击事件。
为了做到这一点,我们可以为取消按钮指定特定的html。

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();

这篇关于在jeditable上调用取消的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆