When attempting to produce a secondary sort order field using
Pagination, the CakePHP group pointed me into the direction of using
the Model to specify the order.    I'm not for sure if the following
is a feature or side effect in version 1.1, but the order that you
place your associations effects the consequential sort order
fields.    In belows example the default sort order is User.last_name,
State.name, EngType.name.    When Pagination sets the primary sort to
State, the secondary will be User.last_name.

    var $belongsTo = array(
                        'User' =>
                                array('className' => 'User',
                                      'foreignKey'  => 'emp_id',
                                      'order' => 'User.last_name',
                                ),
                        'State' =>
                                array('className' => 'UsState',
                                      'foreignKey'  => 'state_id',
                                      'order' => 'State.name',
                                ),
                        'EngType' =>
                                array('className' => 'TsConfig',
                                      'foreignKey'  => 'eng_type_id',
                                      'order' => 'EngType.name',
                                ),
                        'Status' =>
                                array('className' => 'TsConfig',
                                      'foreignKey'  => 'status_id',
                                ),
        );


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to