jmarrdiaz
9/6/2016 - 12:05 PM

Eliminar multiples checkbox

Eliminar multiples checkbox

CSS:
.checkboxzoom {
	-ms-transform: scale(1.5); /* IE 9 */
	-webkit-transform: scale(1.5); /* Chrome, Safari, Opera */
	transform: scale(1.5);	
}

CHECKBOX EN DATATABLE:
<td style="text-indent: 25px"><input type="checkbox" id="check{{ $tarifa->id }}" class="checkboxzoom" /></td>

JAVASCRIPT:
function eliminar_tarifa(){   
    
    $.ajax({        
            url: 'get_num_tarifas',
            type: "post",
            //Example multiple data: "id=" + id + "&id_group=" + id_grupo,
            data: "tpv=" + vm.$get('tpv'),
            success: function (data) {                
                $(data).each(function(index) {                  
                  if ($('#check' + data[index]['id_tarifa']).is(':checked')) {                
                    //alert('se borraria el id ' + data[index]['id_tarifa']);
                    $.ajax({        
                  url: 'del_tarifa',
                  type: "post",
                  //Example multiple data: "id=" + id + "&id_group=" + id_grupo,
                  data: "id_tarifa=" + data[index]['id_tarifa'],
                  success: function (data) {
                    //Refrescar la tabla 
                    window.location.reload();
                  }
              });
                  } 
                })                                                  
            }
        });
  }

  $('#tarifas_wifi').append('<tfoot><tr></tr><td style="text-indent: 7px"><a title="Eliminar seleccionados" href="#" onclick="eliminar_tarifa()" <i style="font-size: 20px" class="fa fa-trash-o" aria-hidden="true"></i></a></td></tfoot>');