CJuiSliderInput multiple times

I want to use CJuiSliderInput multiple times. why is this not possible?

look at this please




$tasks=Task::model()->with(

    'children'

    )->findAll(array(

    'condition' => 't.parent_id = 0',

    'order'=>'t.create_time'

));


foreach ($tasks as $task){

    echo "<br>_________<br>";

 $this->widget('zii.widgets.jui.CJuiSliderInput', array(

     'model'=>$task,

     'attribute'=>'start_time',

     'maxAttribute'=>'end_time',

     // additional javascript options for the slider plugin

     'options'=>array(

         'range'=>true,

         'min'=>0,

         'max'=>24,

     ),

 ));

      echo "<br>--------------<br>";  

    }

it shows only for the first item, and does not show for the others. it shows no error message

here is the output HTML


_________

<br>

<input id="Task_start_time" type="hidden" value="0" name="Task[start_time]">

<input id="Task_start_time_end" type="hidden" value="130" name="Task[end_time]">

<div id="Task_start_time_slider" class="ui-slider ui-slider-horizontal ui-widget ui-widget-content ui-corner-all" name="Task[start_time]_slider">slider=Object { element={...}, options={...}, _keySliding=false, more...}jQuery16101772517267628293=Object { events={...}, handle=function()}

<div class="ui-slider-range ui-widget-header" style="left: 0%; width: 0%;"></div>

<a class="ui-slider-handle ui-state-default ui-corner-all" href="#" style="left: 0%;"></a>jQuery16101772517267628293=Object { events={...}, handle=function()}index.uiSliderHandle=0

<a class="ui-slider-handle ui-state-default ui-corner-all" href="#" style="left: 0%;"></a>jQuery16101772517267628293=Object { events={...}, handle=function()}index.uiSliderHandle=1

</div>

<br>

--------------

<br>

<br>

_________

<br>

<input id="Task_start_time" type="hidden" value="0" name="Task[start_time]">

<input id="Task_start_time_end" type="hidden" value="0" name="Task[end_time]">

<div id="Task_start_time_slider" name="Task[start_time]_slider"></div>

<br>

--------------

Make sure you set unique IDs for each slider, e.g.




  'id' => 'Task'. $task->id,



should it be in htmloptions?

I believe you can put it either in htmlOptions, or outside that as well next to model, attribute, etc.

that was perfectly perfect!

thank you

this is a new problem, in the same context

that code for Sliders is inside a CListView, which I update using $.fn.yiiListView.update

now the new problem is that when I update the list all sliders disappear.

I’m not entirely sure if this will work, but my guess would be to try and setup the afterUpdate function in yiiListView to initialize new sliders with the data that gets sent back. You should be able to view the source in your browser to take a look at the current slider Javascript that Yii generates and modify that to suite your needs.

:(

that looks too much for a newbie like me.

I understand as far as afterUpdate, then I don’t