I use the JEditable plugin for in-place editing.
I have a setup function that calls .editable() for all the relevant classes. The problem is that I have recently added elements that I would like to make editable. Obviously, when added, .editable() will never be called on them.
In other words, I want to get the effect that the jquery live() function does, but for the editable() function.
My current workaround seems ugly to me ( redscribe_button is the button that you need to click to edit the text):
$(".redescribe_button").live("click", function(click_event) { click_event.preventDefault(); $(".editable", $(this).parent().parent()).editable("/temp/", { event: "make_editable", indicator : 'Saving...', tooltip : 'Click to edit...' }); $(".editable", $(this).parent().parent()).trigger('make_editable'); });
In other words, I just call .editable every time the edit button is clicked.
Any ideas for a better solution?
javascript jquery jeditable
Edan maor
source share