Using .live event with jeditable
Hy there,
I add some div's I want to edit with prepend to my list. But after adding them with prepend I can't edit them unless i refresh. I found out that I had to use the .live function for it but I dont know how to apply to jeditable.
I have a method but I placed an event over an even and now I need to double click the first time or everytime I prepend something.
The jeditable event
- $('.edit').editable('functions.php', {
indicator : 'Opslaan...',
tooltip : 'Klik om te bewerken...'
});
My temporary solution is this
- function edit(){
$('.edit').editable('functions.php', {
indicator : 'Opslaan...',
tooltip : 'Klik om te bewerken...'
});
}
$('.edit').live('click', function(){edit()});
How can I make this work correctly without this stupid workaround ?
I also tried to change the jeditable.js file
- $(this).bind(settings.event, function(e) {
==to==>
$(this).live(settings.event, function(e) {
- .unbind($(this).data('event.editable'))
==to==>
.die($(this).data('event.editable'))
but after that it didnt work anymore.
Hope you guys can help me fast.
Grtz,
Dietger