[SOLVED] cgridview comparison operator

Hi Everyone,

I am new to Yii and need some advice. I have two tables - project & rates. Rates table has a project_id field. In rates admin view I am displaying a "value" field from project table:


			'name' => 'projectvalue',

			'type' => 'raw',

			'value' => 'CHtml::encode($data->project->value).


and it displays fine. My problem is when I try to filter by entering >=15000 it returns no entries. It does work if I enter 15000 (without any operator). It appears that it is seeing this column as text values and not numeric. Am I missing something simple or should I use a different approach?

In model I have:

public $projectvalue;

and in search I have included:




Any help would be greatly appreciated. Thakks in advance.

It’s because you are using the addSearchCondition() that does not parse the operator…

delete that line and…

Use just the compare()

compare() does evaluate the operator if it’s there and calls appropriate criteria methods…

Thanks for your help mdomba, that did it.