How Show Newly Added Data First On Top Of Page In Gii Making Pages.

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

share code




$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

Aslam O Alaikum

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

Just need to use -


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