Pregunta

as the title says, I'm embedding a CJuiProgressBar inside a CGridView column using the following syntax:

array (
  'name'=>'cantidad_mails',
  'value'=>'$this->grid->Controller->createWidget("zii.widgets.jui.CJuiProgressBar",array(

    "value"=>intval($data->porcentaje),
    "htmlOptions"=>array(
      "style"=>"width:80px; height:20px; float:left; background-color:#44F44F ;background:#EFFDFF",
      "color" => "red"
    ),
  ))->run()',
),

And it's working fine the first time the page with the grid is loaded, but if I click on one of the pagination links of the grid, the progress bars disappear from the column.

Anyone know how to fix that? Thanks.

¿Fue útil?

Solución

The problem is that grid pagination is made via ajax, so after ajax update progress bar is not reinitialized.

The most simple solution is to disable ajax updates, which are anyway not efficient.

You can do this by setting ajaxUpdate of your grid config to false.

Option #2 is to reinit your progress bar by configuring afterAjaxUpdate option of your grid. Here are docs regarding afterAjaxUpdate

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top