문제

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.

도움이 되었습니까?

해결책

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

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top