I have a related field in a custom module that links to a contact. If I activate sorting for this field (listviewdefs.php: sortable=>true) sorting works correctly by using the name field of the contact.
How could I sort by the last_name and then the first_name instead?
If first_name and last_name both are db fields then you can apply sorting on listview just like name field (listviewdefs.php: sortable=>true). You only need to add this code
first_name' => array( 'query_type'=>'default'),
'last_name' => array( 'query_type'=>'default'),
in searchFields.php file.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With