DB default value in FILTER. What for?


(Vuliad) #1

I can’t understand one thing…

If i set in mysql Default Value for column - this automaticaly set’s on filter in admin view.

Is there a way to keep default value, and in CGridView admin filter by default = "no filter" on this column ?


(Piluhin) #2

I confirm this -I have the same problem. Filter boxes take default values from model columns and can not be set to ‘empty’ or cleared.

OR


(Jose Reyes) #3

Same problem here. Does anyone know how to get around this?


(J Theill) #4

In my actionAdmin() function I just set the value in the model to NULL.




$model=new Post('search');

$model->views = NULL;




(Yugenekr) #5

Have the same problem.

Setting attributes to NULL (as described above) works but I think all filters should be set to NULL by deafault.

new issue was already added - Issue 1050: DataGrid filter default values are not NULLs and can not be cleared