vendredi 8 janvier 2016

jQuery select all checkbox checking other tab's rows also

I have 5 tabs when i am checking select all check box on current tab it is checking other tabs rows also.Plz help me. Below code:

$('.group-checkable').click(function() {
  var $checkboxes = $(':checkbox');
    $checkboxes.prop('checked', $(this).is(':checked'));
});

  $(document).delegate('.deleteAll', 'click', function() { 
    if($('input[name=credential_id]:checkbox:checked').length>0){
      var check = confirm("Do you wish to continue?");
      if(check){ 
      var credential_ids = new Array(); 
      $('input[name=credential_id]:checkbox:checked').each(function(i){      
          credential_ids[i] = $(this).val();
      });
      $.ajax({
          url: 'credentials/delete',
          type: 'GET',
          datatype:'json',
          data: { credential_ids:credential_ids},
          success: function(response) {
            console.log(response);
          },
        });
      } `enter code here`
    }
    else{
      alert("Sorry..No Record Selected..!");
    }   
  });




Aucun commentaire:

Enregistrer un commentaire