Invoke Jeditable from link
I开发者_如何学编程'm trying to build edit in place functionality, but I want to invoke element with outside link. Lets say I'm building right-click menu with edit.
Thank you for help
If I understand what you want correctly, you want to do the following:
- Only make an element editable when a user do some action (e.g. click a button)
- After the user finishes editing the element, the element becomes uneditable again, until the triggering action is performed again.
If that's the case, you can do something like this:
$('button').click(function() { // an action to trigger editing
$('#editable').editable('', {
// when the editing is done, make this element uneditable
onreset: function() { $(this).parent().editable('destroy'); }
})
// pseudo click the editable element, so it is in the "editable" mode
.click();
});
Example: http://jsfiddle.net/william/DqbeN/.
精彩评论