CgridView Filter

Hello Guys,

i’m in big trouble because it’s been for a week trying to understand how filter work.

let’s start from beginning.

I have 2 tables like that (it’s not exaclty like that but to undertant just that TableA has foregn key for tableB):


id id_bank date value


id_bank descrip

relations is created correctly.

with gii i created the models for both tables.

and i created a view with 2 grids, ones for TableA and once for TableB

Here attached you can find relative files, where in TableA i put just the search function to be more clear.

My target should be filter the date on tableA and with that value filter also TableB (note that TableB doesn’t have a date attribute).

i understood that the whole cycle should be:

1 - actionMovments called.

2 - modelA and modelB created with all NULL attributes.

3 - modelA and modelB search function is called to create the dataprovider with all records

3 - when i filter date column actionMovments is called again

4 - a new modelA and modelB, but this time attribute date is get with function $_GET[]

5 - pass this new models to the view

6 - model search is called again and $this->date attributes this time has the date

7 - tableA is updated correctly but now the strange thing:

at this point $modelA->date should have the date, instead it’s NULL…

and i can’t use that value to filter the second grid.

i tried many ways to get that date value from filter but nothing…

another thing tried is when i arrive at point 4 i should have the value, so i tried to save it in another value $year and try to pass a new variable to the view…


but nothing, even though in the debug i see that the attribute is correctly present in the model i can’t pass it again in the view…

I tried also an ajax call, i get the value save in variable $year, but nothing, the render is done just with $modelA and any other value i try to pass gives always NULL.

maybe to have been clear enough. i need to resolve this problem. Maybe i miss something and i would need understand what.

ohh i forgot… i use firebug and effectively the page is updated with the correct value but the render show the old page and it’s not done the refresh i guess…

anybody knows how to resolve the problem?

thank you very much to all…

I’m waiting your suggestions.

bye bye