2 Cgridviews From Carraydataprovider On One Page

When I use this example http://www.yiiframework.com/wiki/232/using-filters-with-cgridview-and-carraydataprovider/ for one CGridView with filter on page all works fine

Filter fields on the top of grid have names like FiltersForm[column_name]

But when I render two CGridViews with filters, both filters are nested from FiltersForm class. So fileds in both grids have same names.

How to set names for fileds in filters for example GridOne[column_name] & GridTwo[column_name]?

I believe you can specify the header name.

Yes, I could specify header name, but it does’nt make any effect on filters filds name

Solved in this way




        $firstGridFilters=new FiltersForm;

        $secondGridFilters=new FiltersForm;


        if (isset($_GET['ajax']) && $_GET['ajax'] == 'firstGrid' && isset($_GET['FiltersForm']))

        {

            $firstGridFilters->filters=$_GET['FiltersForm'];

        }

        elseif (isset($_GET['ajax']) && $_GET['ajax'] == 'secondGrid' && isset($_GET['FiltersForm']))

        {

            $secondGridFilters->filters=$_GET['FiltersForm'];

        }


        $firstfilteredData=$firstGridFilters->filter($firstDataProvider);

        $secondfilteredData=$secondGridFilters->filter($secondDataProvider);