Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

jeditable - disable it at runtime

is it possible to disable jeditable for a table at runtime?

The case:

I got different steps for the User, the table is always visible, but should be just in one single step editable. The user can switch the steps as he likes.

I found nothing about that in the jeditable docs.

I tryed to remove the triggering class, but after initialization, it does not effect the "editability" ("editability" is more german than english, but I guess you understand me ;)).

Thanks!

like image 211
maddin2code Avatar asked Feb 20 '11 12:02

maddin2code


2 Answers

This is an example. I hope can help you:

$(document).ready(function() {
     $(".editable").editable("http://www.example.com/save.php";, {
         indicator : '<img src="img/indicator.gif">',
         type : "textarea",
         submit : "OK"
     }, function(value, settings) {
         $(this).unbind(settings.event);
     });
});

From this link jEditable: how to remove behaviour answered by plugin's author

like image 147
Fran Verona Avatar answered Oct 23 '22 10:10

Fran Verona


IMHO, the simplest way is:

jQuery(".editable").editable('disable');

and if you need to enable it back

jQuery(".editable").editable('enable');
like image 32
Wilman Arambillete Avatar answered Oct 23 '22 09:10

Wilman Arambillete