I created CGridView in Yii, and one of my columns has the default value of ‘0’ prefilled in when the page loads.
It’s an ID column that references to another table in the database. The ID column, though, is in the same table as all the other columns, and yet is the only one that has a ‘0’ as default filter.
The values of the ID aren’t all 0, so when the page loads, it leaves some results out.
I hope someone can help me with this problem, thank in advance!
You have to clear the default values (i.e., setting null instead of ‘0’ for the ID) using CActiveRecord::unsetAttributes() as you see in the admin action of the gii-generated CRUD.