Relational gridview sort

hi there

i have 3 tables: au, exam and college.

in au’s gridview there are two columns name exam.title and exam.college.title

there is no problem in exam.title sorting but i cant sort the exam.college.title.

there is exam.college.title is unknown!




//use joinwith relation

$dataProvider->setSort(

            [

            'attributes' => [ 

                'exam.college.title' => [

                    'asc' => ['tbl_college.title' => SORT_ASC],

                    'desc' => ['tbl_college.title' => SORT_DESC],

                ],

            ]

            ]

        );



Post your searchModel code for more…

thanks.

worked.