jQuery JEditable-如何在单击编辑时禁用 [英] JQuery JEditable - How to Disable on click editing

查看:81
本文介绍了jQuery JEditable-如何在单击编辑时禁用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想知道您是否可以停止单击时编辑文本?我有一个单独的编辑按钮来使文本可编辑,这是我希望用户能够编辑文本的唯一方法,因此要关闭单击编辑吗?

I was wondering if you can stop text being editable on click? I have a separate edit button to make the text editable and that's the only way that I want the user to be able to edit the text, so want to turn off the on click editing?

有什么想法吗?

推荐答案

Britt是正确的,添加一个自定义事件,并使用按钮触发它.这是一些解释它的代码:

Britt is right, add a custom event, and trigger it with a button for example. Here is some code to explain it:

自定义事件:

$('#id').editable('http://www.example.com/save.php', {
    event : 'custom_event'
});

和触发器:

<button onclick="$('#id').trigger('custom_event');">click to trigger</button>

这篇关于jQuery JEditable-如何在单击编辑时禁用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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