⚠ In case you've missed it, we have migrated to our new website, with a brand new forum. For more details about the migration you can read our blog post for website migration. This is an archived forum. ⚠

  •     

profile picture

refresh the list when i click in own action



carlinchisart
  • profile picture
  • Member

Posted 16 August 2012 - 04:47 AM

hi all!

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.

carlinchisart
  • profile picture
  • Member

Posted 22 August 2012 - 20:51 PM

well i solved the problem by looking the code of GC. (I hope @web-johnny not put furious :) )

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.

Luis Sacristán
  • profile picture
  • Member

Posted 24 October 2012 - 10:30 AM

Has you try?


oTable.fnDraw();