Using zii.widgets.grid.CGridView with join

I have added a join ($criteria->join=‘LEFT JOIN Client ON’; ) to the search() method in the Invoice Class so that in admin view I can display the relative Client name. However in doing this the value for Invoice.Id has been replaced by the value for Client.Id when viewed in ?r=invoice/admin. I have read through what may need to be changed in CGridView to overcome this but maybe I need to add an alias into the search method to distinguish between the two ids.

Can anyone shed any light on this? I don’t know how to add this alias or what the syntax/format should be.

You have to specify the ‘select’ option to be ‘primaryTable.*’.

In the upcoming 1.1.4, this is no longer necessary.

Thanks so much for the reply. It has finally solved this issue for me.