Hello
In controller I use CActiveDataProvider for fetching my data from database.
In view I use zii.widget.CListView for showing the data but I want to put each 3 results in a div.
Please help me,
Page 1 of 1
Question About Cactivedataprovider
#2
Posted 13 October 2012 - 04:37 AM
I guess you can apply some styling (specifying width + floating the div).
You can also specify which CSS file / CSS classes you want to use in your ListView.
http://www.yiiframew...i/1.1/CListView
You can also specify which CSS file / CSS classes you want to use in your ListView.
http://www.yiiframew...i/1.1/CListView
#3
Posted 13 October 2012 - 09:17 AM
I didn't find answer my question in that page. I want this position
<div class='row'> // data item 1 // data item 2 // data item 3 </div> <div class='row'> // data item 4 // data item 5 // data item 6 </div> . . . until end
#4
Posted 13 October 2012 - 10:01 AM
The idea is to change the styling of the container div, in order that it has like 30% width and that it floats left, and 5% right-margin.
Otherwise, you can just use this extension that renders the listview items into a table of as many columns as you want: http://www.yiiframew...columnlistview/
Otherwise, you can just use this extension that renders the listview items into a table of as many columns as you want: http://www.yiiframew...columnlistview/
#5
Posted 14 October 2012 - 12:35 AM
You can use $index variable in your partial view for the CListView.
http://www.yiiframew...itemView-detail
<?php if ($index % 3 === 0): ?> <div class="row"> <?php endif; ?> ... rendering item ... <?php if ($index % 3 === 2 || $index === $widget->dataProvider->itemCount - 1): ?> </div> <?php endif; ?>
http://www.yiiframew...itemView-detail
Share this topic:
Page 1 of 1

Help













