How To Modify The List View Widget

Hello there,

I wanted to modify the default list view provided by the Yii framework. The current view display everything in a line. What I want is to display the information in following format. Could you suggest me how can I extend this widget and create my own view. I have attached both needed as a image. I am new to Yii so all help would be really appriciable. If there is already any widget in this format I would be so happy.

hi ashish i think you can modify the design in framework/zii/widgets/CBaseListView.php

in that see "renderkeys" function modify that according to your design.

Ok but wouldn’t that affect other view as well

CListView class has got a public property called cssFile.

Then, you can make your own css file to CListView and change it.

$this->widget(‘zii.widgets.CListView’, array(

'dataProvider'=>$dataProvider,


'itemView'=>'_view',


    [i][color="#0000FF"]'cssFile'=>'path to css file'[/color][/i],

));

You also can create a inherits class from CListView and overrite properties, methods and maybe change the view (I’m not sure this).

Regards.