SHARE
TWEET

Untitled

a guest Jan 20th, 2020 58 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. $("#dataTables-example tr").each( function(){
  2.     $(this).find("button.editar").on("click", function(evt){
  3.         evt.stopPropagation();
  4.        
  5.         console.log($(this).closest("tr").hasClass("locked"));
  6.  
  7.         if ($(this).closest("tr").hasClass("locked")) {
  8.             $("#myModalEdit input").attr("disabled", true);
  9.             $("#myModalEdit .testee").attr("disabled", true);
  10.             $("#myModalEdit .lockar").attr("disabled", true);
  11.            
  12.         } else{
  13.             $("#myModalEdit input").removeAttr("disabled");
  14.             $("#myModalEdit .testee").removeAttr("disabled");
  15.         $("#myModalEdit .lockar").removeAttr("disabled");
  16.         }
  17.        
  18.        
  19.         var c_line = $(this).closest("tr");
  20.        
  21.         $("#myModalEdit .lockar").unbind();
  22.         $("#myModalEdit .lockar").click(function(){
  23.             $(c_line).addClass("locked");
  24.            
  25.             $(this).attr("disabled", true);
  26.             $("#myModalEdit input").attr("disabled", true);
  27.             $("#myModalEdit .testee").attr("disabled", true);
  28.         });
  29.   })
  30.  
  31.   //console.log($('#myModalEdit input#idprontuarioo').val( $(this).val()));
  32.  
  33. });
  34.  
  35. $('#myModalEdit').on('shown.bs.modal', function () {
  36.     $('#myModalEdit input').trigger('focus');
  37. });
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Top