Yii Framework Forum: Widget In Loop - Yii Framework Forum

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Widget In Loop

#1 User is offline   sarthak 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 11
  • Joined: 19-December 12
  • Location:Ahmedabad, Gujarat, India

Posted 05 February 2013 - 07:37 AM

This is the most important note, when you are putting widget in any loop.

Here we have to distinct any number of instances of widget.

So we are providing ID to widget.

'id' property should in htmlOptions.

eg.

$i=0; // provide different id

foreach($model as $list)

{

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

'htmlOptions'=>array(

'id'=>$i; ),

..

..

);

$i++;

}
0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users