Yii Framework Forum: How To Modify The List View Widget - Yii Framework Forum

Jump to content

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

How To Modify The List View Widget Rate Topic: -----

#1 User is offline   Ashish Tyagi 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 34
  • Joined: 13-December 12

Posted 18 December 2012 - 11:04 AM

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.

Attached File(s)


Thanks
Ashish Tyagi
0

#2 User is offline   Kollipara Rama Krishna 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 16
  • Joined: 12-May 12

Posted 19 December 2012 - 06:56 AM

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.
0

#3 User is offline   Ashish Tyagi 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 34
  • Joined: 13-December 12

Posted 19 December 2012 - 11:05 AM

View PostKollipara Rama Krishna, on 19 December 2012 - 06:56 AM, said:

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
Thanks
Ashish Tyagi
0

#4 User is offline   lagogz 

  • Advanced Member
  • PipPipPip
  • Yii
  • Group: Members
  • Posts: 421
  • Joined: 30-November 12
  • Location:Galiza

Posted 19 December 2012 - 11:42 AM

View PostAshish Tyagi, on 19 December 2012 - 11:05 AM, said:

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',
'cssFile'=>'path to css file',
));

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

Regards.
-----------------------------------------------------------------------------------------------
------------------------------- VISITEN FOCUCHASART --------------------------------
-----------------------------------------------------------------------------------------------
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