gridview dropdownlist filter not working correctly

Hello everyone,

i have an gridview and as the filter i have used a dropdownlist.

this is my column property for the gridview,:

    array(


        'name'=>'foot',


        'sortable'=>false,


        'filter'=>CHtml::dropDownList('Players[foot]', '',  


            array(


                ''=>'Both',


                'righ'=>'Right',


                'left'=>'Left',


            ))


    ),

when i load the page and select left or right it is working correctly, but if i want to switch back to both, nothing happens whats do i have to do to get this to work?.

Thanks in advance.

Try this instead:




        array(

            'name'=>'foot',

            'sortable'=>false,

            'filter'=>CHtml::dropDownList('Players[foot]', '',  

                array(

                    'righ'=>'Right',

                    'left'=>'Left',

                ),

                array(

                    'empty'=>'Both',

                ))

        ),



http://www.yiiframework.com/doc/api/1.1/CHtml/#dropDownList-detail

Or, you may simply try this:




        array(

            'name'=>'foot',

            'sortable'=>false,

            'filter'=> array(

                    'righ'=>'Right',

                    'left'=>'Left',

                )

        ),



You can give an array as ‘filter’ property of the data column, and the dropdown list will be created as an input filter.

http://www.yiiframework.com/doc/api/1.1/CDataColumn/#filter-detail