refresh the list when i click in own action
- Single Page
Posted 16 August 2012 - 04:47 AM
i use a add_action, for generate a own functionality, but i want when this function finish my list refresh or reload , like when i click in delete option.
so, how i call this option? or how i refresh the list?
thanks.
Posted 22 August 2012 - 20:51 PM
i'm goin to explain, how i do this.
firts in my controller when i add the action i put a own class called 'imprimirFactura'
$crud->add_action('Imprimir Factura', base_url() . 'images/imprimir.jpg', '', 'imprimirFactura', array($this, 'redirecImprimirFactura'));
in a view file or javascript file, i add the next code:
$(document).ready(function(){
//recorrido para ponerle javascript a la instruccion de imprimir reporte
$('.imprimirFactura').live('click', function(e){
e.preventDefault();
var message_alert='Esta seguro que desea imprimir la factura? no podra editarla despues de esto';
var url = $(this).attr('href');
if( confirm(message_alert) )
{
window.location=url;
$('#ajax_refresh_and_loading').trigger('click');
$('#report-success').html('La factura se genero a pdf correctamente' ).slideUp('fast').slideDown('slow');
}
});
});
the function for refresh the list are:
$('#ajax_refresh_and_loading').trigger('click');
$('#report-success').html('La factura se genero a pdf correctamente' ).slideUp('fast').slideDown('slow');
I hope it helps someone later.
Posted 24 October 2012 - 10:30 AM
oTable.fnDraw();