Hidden Column of CGridView

Hi all,

I want to ask about : How to hide a column in CGridView.( it’s still can be viewed from view page source ) ?

Thanks for any suggestion or example.

explorer

Ha haa, this is my problem a long long time ago

cek this cool thread…

8)

Thanks a lot fast…

I have read it.

but i still new in webprog, can you help me to show how to use style css display none

like you said in your post.

Thanks fas

oh sorry, i miss it. :lol:

to ‘display:none’, you can add htmlOptions property :




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

        'id'=>'t-user-grid',

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

        'filter'=>$model,

        'columns'=>array(

                array(

                        'name'=>'name',

                        'value'=>'$data->name',

                ),

                array(

                        'name'=>'email',

                        'value'=>'$data->email',

                        'htmlOptions'=>array('style'=>'display:none'),

                ),

                array(

                        'class'=>'CButtonColumn',

                ),

        ),

));