In my model i’ve a ‘isActive’ Status (true/false, 0/1)
In the _search i’ve a dropdown combo for true/false with empty => ‘all’
In the CGridView i’ve the field declares as
array (
'name'=> 'isActive',
'value'=> 'Helper::booleanFormatter($data->isActive, "active","disabled")',
'filter' => array("1" => 'active', "0" => 'disabled);
),
where …
public static function booleanFormatter($value, $true, $false) {
return ( $value ? Yii::t('general', $true) : Yii::t('general', $false) ) ;
}
I need the the first time user view ‘/admin’, user see only active records. I need a default filter to ‘isActive=1’, but obviously, if user change it, the filter must be what the user want…
How to ?