I have question about zii.widgets.grid.CGridView.

This my code.




$this->widget('zii.widgets.grid.CGridView', array(

	'id'=>'member-grid',

	'dataProvider'=>$model->search(),

	'filter'=>$model,

	'columns'=>array(

		'id',

		'username',

		'password',

		'name',

		'address',

		'email',

		array(

			'class'=>'CButtonColumn',

		),

	),



but I would have filter columns as id , username

How I do ?

(sorry , I am not good english)

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

    'id'=>'member-grid',


    'dataProvider'=>$model->search(),


    'filter'=>$model,


    'columns'=>array(


            'id',


            'username',


            


            array(


                    'class'=>'CButtonColumn',


            ),


    ),

Try this please!

I would like to have columns id, username ,password,name,address,email in table gridview but filters search I would like to have columns id , username , by default of gridview generate filters search id, username ,password,name,address,email , I don’t want to show row search columns (username ,password,name,address,email ) in table gridview

you have to set CDataColumn’s filter attribute to false, to do so it’s best to define columns as arrays instead of strings.







$this->widget('zii.widgets.grid.CGridView', array(

	'id'=>'member-grid',

	'dataProvider'=>$model->search(),

	'filter'=>$model,

	'columns'=>array(

		'id',

		'username',

   	array(

            'name' =>'password',

            'filter' => false

 		),

   	array(

           'name' =>'name',

            'filter' => false

        )

        array(

            'name' => 'address',

            'filter' => false

        )

        array(

            'name' => 'email', 

            'filter' => false

        ) 

        array(

            'class'=>'CButtonColumn',

        ),

	),



sorry for bad formatting

It work, Thank you so much.