Cita:
Iniciado por diurno10
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<script type="text/javascript">
jQuery(document).ready(function($)
{
$("#table-1").dataTable({
"sPaginationType": "bootstrap",
"iDisplayLength": 5,
"aLengthMenu": [[5,10, 25, 50, -1], [5,10, 25, 50, "Todos"]],
"bStateSave": true,
"bProcessing": true,
"bServerSide": true,
"sAjaxSource": '<?php echo base_url(); ?>panel/premios/list_all',
"fnInitComplete": function () {
},
'fnServerData': function (sSource, aoData, fnCallback) {
$.ajax
({
'dataType': 'json',
'type': 'POST',
'url': sSource,
'data': aoData,
'success': fnCallback
});
}
}
);
$(".dataTables_wrapper select").select2({
minimumResultsForSearch: -1
});
$(".del").on("click",function(e) {
console.log('entro');
return false;
e.preventDefault();
var url = $(".del").attr('href');
$('#modal-4').modal('show', {backdrop: 'statuc'});
});
});
</script>
pero cuando hago click en el link se ejecute directamente no toma el return false

estoy haciendo algo mal?