Yii Framework Forum: DB default value in FILTER. What for? - Yii Framework Forum

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

DB default value in FILTER. What for? Rate Topic: -----

#1 User is offline   vuliad 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 2
  • Joined: 18-October 09

Posted 20 March 2010 - 11:43 AM

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 ?
1

#2 User is offline   OYR 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 4
  • Joined: 25-November 09

Posted 23 March 2010 - 11:47 AM

View Postvuliad, on 20 March 2010 - 11:43 AM, said:

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 ?


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
0

#3 User is offline   JFReyes 

  • Advanced Member
  • PipPipPip
  • Yii
  • Group: Members
  • Posts: 508
  • Joined: 28-October 09
  • Location:Puerto Rico

Posted 24 March 2010 - 09:34 AM

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

#4 User is offline   Theill11 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 51
  • Joined: 03-March 10
  • Location:@ localhost

Posted 25 March 2010 - 09:07 PM

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

$model=new Post('search');
$model->views = NULL;

0

#5 User is offline   yugene 

  • Advanced Member
  • PipPipPip
  • Yii
  • Group: Members
  • Posts: 513
  • Joined: 08-August 09

Posted 26 March 2010 - 05:18 AM

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
0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users