Filter A Cactivedataprovider

Hello everyone,

in the header i have a searchbar wich redirects to a search action with a GET query parameter.

This query variable will be passed to a function called querySearch in my model and will return a CDataProvider filled with the data.

This data will be loaded into a CGridView on the search page, but now i want to filter this data with textboxes/droplists in the table headers. But when i filter the data it will return all results from the whole table instead of filtering the data from the previous CDataProvider.

Code: http://pastebin.com/0VM0zfwS

Thanks in advance.

If I have understood your problem, For second time, you will not get value for $query, the text being searched from previous request. You also need to pass the searched text while filtering.

You can save the the searched text in one of the model’s property and use this property directly in querySearch/search for searching/filtering.