Grid Filter

Hi,

last year I made a yii app with yii 1.1. Now I’m testing with yii 2 and maybe want to switch my app to the new version.

I’m testing with the gridview and it seems not possible as user to filter with simple operators like in yii 1.1.

eg. we had a price column and it was possible to enter >50 in the column filter and it was showing every entry with a price greater than 50. Now it’s showing an error, I have to enter a number.

Is it only an parameter to enable the smarter filter options? Or maybe I have to implement it by myself?

you have to implement it yourself.

filtering data

Ok thanks. I’ll take a look on it.

But atm I’m stuck with relations in the gridview. I can see in var_dump that it’s loading the informations from a differet model but I always get “not set” in the column. I dont see a difference between the guide and some google solutions and my code.

I found the problem with the relation. Gii was generating a hasMany relation which was causing the issue with the empty column.

Can you give me a small code example how to bring a simple smartfilter feature (> and <) into the searchmodel without breaking the validation?