I have a _view.php page which displays items from database, one of things that is displayed is progress bar
But when pagination occurs, when i click next page, there is no progress bar rendered, when i go back to the first page it doesn’t render previously rendered progress bars.
This is what I use to render each item:
//I calculate the $pb_value in
<div class="projectstat">
$this->widget('zii.widgets.jui.CJuiProgressBar', array(
'value'=>$pb_value,
'htmlOptions'=>array(
'style'=>'height:20px; width:204px; margin:auto; display:block;'
),
));?>
</div>
What is the problem here? I guess pagination somehow ruins the progress bar logic?
Yes, it is the solution. but, how should that function look like? Can you provide some simple example?
My controller is making dataprovider, it is rendered in CListView using _view.php from index.php
Once page is rendered, $this->widget() code I posted above, which is located in _view.php produces divs which are named yw1, yw2, yw3… and yw0 is div which holds all items.
I managed to reinit the progress bar putting something like this
$(#yw1).progressbar({‘value:0’})
$(#yw2).progressbar({‘value:0’})
.
.
.
into afterajaxupdate property, but I calculate values in php, from certain data I have from database.
TL;DR; i can get progressbars to show up, but I can’t reinit their values.
As you can see, my progress bar value is calculated in _view.php file, but afterajaxupdate calls reinstallprogressbar in index.php, and I can not pass values to it in order to correctly reinit progress bars, (they are re-initalised, but I can not get the values, they are all = 0).