Hi dear,

I have a Table with 20 million record,

How can I prevent fill grid-view on page load??????

I googled, but I can not find any solution :(

please help me


There’s a discussion here that might be of help.

No, I can’t find solution :(

Did you try using pagination on dataprovider, that is taking to CGridView widget?

Yea,I use pagination, but I dont like fill grid view every page load, because my database have a heavy data

For this you need to create a dataprovider that returns an empty data set check this thread for an idea -

thanks for replay, I use this hint to my model, it is correct?

public function search()


		// Warning: Please modify the following code to remove attributes that

		// should not be searched.

		$criteria=new CDbCriteria;


        $criteria->mergeWith($this->dateRangeSearchCriteria('creation_time', $this->creation_time));









        $criteria->order="id desc";



            return new CActiveDataProvider($this, array(


                'pagination' => array(  'pageSize'=>Yii::app()->user->getState('pageSize',Yii::app()->params['defaultPageSize']),






                 return new CActiveDataProvider('RequestSms',array('data'=>array()));



And I like don show gridview in init form, Is it way to hidden gridview in init view?

thanks for attension