Ver Mensaje Individual
  #3 (permalink)  
Antiguo 07/02/2015, 20:20
Avatar de destor77
destor77
 
Fecha de Ingreso: noviembre-2004
Ubicación: Gálvez, Santa Fe, Argentina
Mensajes: 2.654
Antigüedad: 19 años, 5 meses
Puntos: 43
Respuesta: html datatables

Cita:
Iniciado por diurno10 Ver Mensaje
claro, es xq las filas las cargas por ajax, por lo tanto el dom ya se cargo y jquery en esa instancia no lo reconoce, pero utilizando jQuery.on , no tendrias problemas.

si tu version de jQuery es mayor o igual a 1.7, sino tenes que utilizar .live
$("#delete").on("click",function(e) {
console.log('entro');
return false;
e.preventDefault();
var url = $(".delete").attr('href');
$('#modal-4').modal('show', {backdrop: 'statuc'});

});
Hola diurno10,
intente como me dijiste poniendo asi:
Código Javascript:
Ver original
  1. <script type="text/javascript">
  2.     jQuery(document).ready(function($)
  3.     {
  4.         $("#table-1").dataTable({
  5.             "sPaginationType": "bootstrap",
  6.             "iDisplayLength": 5,
  7.             "aLengthMenu": [[5,10, 25, 50, -1], [5,10, 25, 50, "Todos"]],
  8.             "bStateSave": true,
  9.             "bProcessing": true,
  10.             "bServerSide": true,
  11.             "sAjaxSource": '<?php echo base_url(); ?>panel/premios/list_all',
  12.             "fnInitComplete": function () {
  13.             },
  14.             'fnServerData': function (sSource, aoData, fnCallback) {
  15.                 $.ajax
  16.                 ({
  17.                     'dataType': 'json',
  18.                     'type': 'POST',
  19.                     'url': sSource,
  20.                     'data': aoData,
  21.                     'success': fnCallback
  22.                 });
  23.             }
  24.         }
  25.         );
  26.        
  27.         $(".dataTables_wrapper select").select2({
  28.             minimumResultsForSearch: -1
  29.         });
  30.  
  31.         $(".del").on("click",function(e) {
  32.             console.log('entro');
  33.             return false;
  34.             e.preventDefault();
  35.             var url = $(".del").attr('href');
  36.             $('#modal-4').modal('show', {backdrop: 'statuc'});
  37.  
  38.         });  
  39.     });
  40. </script>
pero cuando hago click en el link se ejecute directamente no toma el return false estoy haciendo algo mal?