How can i combine the following with a delegate in jQuery?
I have a #commentContainer
surrounding all the editable elements, and I am dynamically adding editable fields (Jeditable). the editing ability is not working for dynamically loaded items.
/* Bind Jeditable instances to "edit" event. */
$(".edit").editable('/Comment/PostComment/', {
type: 'textarea',
cancel: 'Cancel',
submit: 'OK',
indicator: '<img src="img/indicator.gif">',
tooltip: 'Click to edit...',
event: "edit"
});
/* Find and trigger "edit" event on correct Jeditable instance. */
$(".edit_trigger").bind("click", function () {
$(this).prev().trigger("edit");
});