cGridView

Hi all,

I have a cgridview that is displaying columns from two tables. Because of space restrictions on the screen I have set some of the columns as ‘visible’=> false,. However I still need to filter on one of the hidden columns. Is there a way I can display a separate text field on the page to allow a user to input a value and then use that input to filter the grid?

Thanks in advance for any help.

You can create a textField or any other HTML form filed for that matter that passes its data through ajax and then updates your GridView.

i.e. echo CHtml::textField(‘ModelName[attribute_name]’, ‘’, array(

                'onkeyup' => CHtml::ajax(array(


                    'url' => CController::createUrl('/controller/actionThatWillRenderYourGrid'),


                    'type' => 'POST',


                    'update' => '#idOfYourGrid')


                )


            ));

Hope that helps!