Advertisement
Guest User

Untitled

a guest
Mar 19th, 2014
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. var countChecked = function() {
  2.         var n = $( ".checkData:checked" ).length;
  3.         if (n > 0) {
  4.           if (n > 1) {
  5.             $(".mailQtd").html(n + ' e-mails selecionados!');
  6.           } else {
  7.             $(".mailQtd").html('1 e-mail selecionado!');
  8.           }
  9.         } else {
  10.           $(".mailQtd").html('Nenhum e-mail selecionado!');
  11.         }
  12.       };
  13.       countChecked();
  14.       $('tr').click(function(event) {
  15.         if (noAction == false) {
  16.             if (event.target.type !== 'checkbox') {
  17.                 $(':checkbox', this).trigger('click');
  18.                 if ($(":checkbox", this).is(':checked')) {
  19.                     $(this).addClass('active');
  20.                 } else {
  21.                     $(this).removeClass('active');
  22.                 }
  23.             }
  24.         }
  25.       });
  26.      
  27.       $(".checkData").on( "click", countChecked );
  28.      
  29.       $("#checkAll").click(function(){
  30.             $('input:checkbox').not(this).prop('checked', this.checked);
  31.             countChecked();
  32.       });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement