admin管理员组文章数量:1336631
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?
Any ideas?
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?
Any ideas?
Share Improve this question asked Jul 30, 2010 at 0:02 user406307user406307 811 silver badge2 bronze badges2 Answers
Reset to default 4Britt is right, add a custom event, and trigger it with a button for example. Here is some code to explain it:
The custom event:
$('#id').editable('http://www.example./save.php', {
event : 'custom_event'
});
And the trigger:
<button onclick="$('#id').trigger('custom_event');">click to trigger</button>
There's an undocumented option event that you can use when you create your jEditable fields.
(It's not actually undocumented but it's just mentioned off-hand in one sentence on the jEditable docs page.)
You can use it to change the event that makes the field editable. You can use any jquery event, even custom events.
For example, on my project I created an edit.mode event that makes the field editable which I can then trigger however I like, with a button, a hotkey, whatever.
本文标签: javascriptJQuery JEditableHow to Disable on click editingStack Overflow
版权声明:本文标题:javascript - JQuery JEditable - How to Disable on click editing - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1742412515a2470070.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论