how show a gridview with a text written in filter column

Hi everyone. I want to call the admin page for a model. It has a cgridview . I want to do it including a text in one column filter(not always the same, depending on conditions). For example

I have 5 columns and i want to show a gridview with a text "ready" in status column, and of course, i want to show only records that status = "ready"

I read about filter property and if i write and array, i get a dropdown, if a write a string i get nothing and if i leave empty i get a textbox.

But i want a textbox with a text in

How can i do that???

Thanks

I did that once by accident. The model for filtering you declare in the gridview widget. Just set its value. Like this:





$model->username = "test";


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

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

'filter'=>$model,.....));




its going to write "test" in the filter and search for as you open the page. Because the filtering row is a model that filters other models.

If you want to get a text INSTEAD of the textbox, you can set the property filter of the colunm:


$this->widget('CGridView', array(

  'columns'=>array(

    array(

         'name'=>'...',

         'filter'=>'My static text',

          )

     )

)