CSort Virtual Attribute Could Use 'with'

Hello,

CSort has been greatly improved by supporting virtual attributes like ‘name’ being sorted as ‘lastname, firstname’ or ‘department’ being sorted as ‘department.name’. In the case of ‘department’, the value comes from a related record (Employee is related to Department via departmentId).

I am making a DB front where the user can sort on all sorts of related information. I would like to pull in the related records only if they are needed. This could be done using CSort if each virtual attribute could also have a ‘with’ parameter. When applyOrder() is called, in addtion to setting $criteria->order, $criteria->with could also be updated. Then the related information would be pulled in as needed.

thanks,

Greg

Another, simpler change–if you don’t want to add a ‘with’ parameter into the CSort class–is that $_directions could be made protected. That way I could use it in a derived CSortWith class to add the functionality while maximizing code reuse.

I am going to use it with a CColumnSelecter class I created to allow the user to choose related columns to show/hide in a grid view.

Thanks,

Greg