Where To Set The 'search' For Cgridview?

Hi, I’ve noticed that in some examples there is an AJAX search bar in top of items of CGridView, but mine is not getting displayed (bootstrap widget).

How can I render it? Which methods should I implement?


It works by default if you use a active record model.

Also you have to use


on the widget

$config = array(


        'name' => 'name',      

        'header' => 'Name',

        'filter' => true, // enable filter for the number field. Default value is true



        'name' => 'number',      

        'header' => 'Number',

        'filter' => false,  // disable filter for the number field



$dataProvider_all = $this->widget('bootstrap.widgets.TbGridView', array(



    'type'=>'striped bordered',

    'template' => "{items}",

    'columns' =>  $config,

    ), true );

echo $dataProvider_all ;

Excellent, thanks!

I haven’t noticed that search() returned a CActiveDataProvider and I was instantiating one apart.

But what was really needed was the ‘filter’ thing.


Thanks jneto