Sortable With Joined Table Fields

I cannot seem to get my CGridView to be sortable with any fields that are joined from other tables. Populating the data is fine, sorting on a field that is part of the immediate table works fine as well.

Here is my example query:

SELECT -> t.*, tableA.testFieldA, tableB.testFieldA as testFieldB

JOIN -> tableC ON (t.tableC_ID =

JOIN -> tableB ON (tableC.tableB_ID =

JOIN -> tableA ON (t.tableA_ID =

In the CGridView:

columns => array(


        'header' => 'Date',

        'name' => 'date', // Works cause it is in the immediate table



        'header' => 'Test Field B',

        'name' => 'testFieldB' // Doesn't sort, alias or no alias



Resolved by following this little link that someone gave me.