Search Cgridview

please,help me all.

I find it difficult to make the search function

this my controller

public function actionDetail() {

$criteria = new CDbCriteria;

$criteria->condition = ‘pengentri =:pengentri’;

$criteria->params = array(’:pengentri’ => Yii::app()->user->id);

$dataProvider = new CActiveDataProvider(‘Data’, array(

‘criteria’ => $criteria,

‘pagination’=>array(

‘pageSize’=>100

),

));

$this->render(‘detail’, array(

‘dataProvider’ => $dataProvider

));

}

this my view

<?php $this->widget(‘zii.widgets.grid.CGridView’, array(

‘id’ => ‘Data-grid’,

‘dataProvider’ => $dataProvider,

‘columns’ => array(

‘id’, // ini nama field pada database

‘nama’, // ini nama field pada database

‘dll’, // ini nama field pada database

)

)); ?>

how to add a search function of data?

thanks you very much. :)

Hi indraW,

Please read this wiki:

http://www.yiiframework.com/wiki/381/cgridview-clistview-and-cactivedataprovider

I always encourage people who are relatively new to CGridView to read the code of "admin" page generated by gii. As you know, it already has a search functionality that you need.

The code will tell you all the things that you have to know about CGridView and CActiveDataProvider. And the wiki will help you understand it.