In my gridview, I have a filter that uses
CHtml::activeDropDownList
with
'multiple'=>'multiple'
and
'empty'=>'All'
. When the CDbCriteria’s compare() runs with the ‘All’ selected in the view, the value is added in condition. I think in this case it should be ignored.
My humble solution to the problem:
public function compare($column, $value, $partialMatch=false, $operator='AND', $escape=true) {
if (is_array($value)) {
if (count($value) == 0 || $value[0] == '') {
//if($value===array())
return $this;
} else {
return $this->addInCondition($column, $value, $operator);
}
.
.
.
What you guys think about it?