Yii Framework Forum: How Show Newly Added Data First On Top Of Page In Gii Making Pages. - Yii Framework Forum

Jump to content

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

How Show Newly Added Data First On Top Of Page In Gii Making Pages. Newly added data not showing top of page it show on last

#1 User is offline   Attique 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 35
  • Joined: 25-November 13

Posted 24 July 2014 - 12:48 PM

Mene ye tareeqa b use kar k dekha hai controller me (I. Also try by adding criteria in Gigi controller but nothing happened i want to show my record newly added first but it shows on last of page please help)
'id' => 'student-grid',
'criteria'=>array(

'order'=>'StudentID DESC',

But kuch b nahe hua is se no luck please help
0

#2 User is offline   PeRoChAk 

  • Advanced Member
  • PipPipPip
  • Yii
  • Group: Members
  • Posts: 578
  • Joined: 26-November 10
  • Location:Lahore, Pakistan

Posted 09 August 2014 - 04:37 AM

share code
Cheers
Perochak
Web Design - Logo Design - Application Development

My Blog | Forums Comparison
0

#3 User is offline   Debasis 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 31
  • Joined: 07-August 14

Posted 09 August 2014 - 05:51 AM

$this->widget('zii.widgets.CListView', array(
    'dataProvider'=>$dataProvider,
    'ajaxUpdate'=>false,
    'template'=>'{sorter}{pager}{summary}{items}{pager}',
    'itemView'=>'_view',
    'pager'=>array(
        'maxButtonCount'=>'3',
    ),
    'sortableAttributes'=>array(
        'id',
        
    ),
));


Try this code in your view page
0

#4 User is offline   alirz23 

  • Master Member
  • PipPipPipPip
  • Yii
  • Group: Members
  • Posts: 879
  • Joined: 08-August 12
  • Location:Durban, South Africa

Posted 10 August 2014 - 01:11 PM

Aslam O Alaikum

Bhai sab ager app apna code share karen ge tu shaid koi app ki madad kar sakay.
0

#5 User is offline   Rohit Suthar 

  • Standard Member
  • PipPip
  • Yii
  • Group: Members
  • Posts: 153
  • Joined: 12-May 14
  • Location:Mumbai, India

Posted 21 August 2014 - 01:14 AM

Just need to use -

'sort'=>array('defaultOrder'=>'StudentID DESC')

Thanks & regards,

ROHIT SUTHAR,
Mumbai(India)

Follow me - @rohisuthar

www.yiiframework.us



Don't be shellfish to click +1 button
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