Quantcast
Channel: Yii Framework Forum
Viewing all articles
Browse latest Browse all 18717

Some Questions About Gridview?

$
0
0
Hi, All.

It's better to explain my questions using demo from yii. So I have demo of blog in yii. By the default all post shows like a list. I would like to see posts in this way:
post1 | post2 | post3
post4 | post5 | post6
post7 | post8 | post9

So I've decide to use the CGridView. I've changed the /view/post/index.php like this:
<?php 
//      $this->widget('zii.widgets.CListView', array(
//	'dataProvider'=>$dataProvider,
//	'itemView'=>'_view',
//	'template'=>"{items}\n{pager}",
//)); 

$this->widget('zii.widgets.grid.CGridView', array(
    'dataProvider'=>$dataProvider,
    //'itemView'=>'_view',
    'template'=>"{items}\n{pager}",
));
?> 


But it works in not proper way. It's rendered simple table.
My questions:
1. Is it right way to do this (I mean in general using GridView. May be there is different way?)?
2. Why I can't use itemView with CGridView?
3. How I can render page with this conditions?

Giulia

PS. Sorry. I know it's stupid questions, but I'm newbie in yii.

Viewing all articles
Browse latest Browse all 18717

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>