As others said before
there is no support in the built in table sort code to allow multiple
column sort, nor the ability to define a default of descending instead
of ascending column
But you should have a look at the following approach with Tablesorter.
For D7:
1.Download and enable Tablesorter Module
2.Download and extract Tablesorter jQuery Plugin into sites/all/libraries/tablesorter
3.Add a CSS class tablesorter
and an unique id to your Views tables in template.php
/**
* Preprocess variables for Views tables.
*/
function YOUR_THEME_preprocess_views_view_table(&$vars) {
$view = $vars['view'];
$vars['classes_array'][] = 'tablesorter';
$vars['attributes_array']['id'] = $view->name . '-' . $view->current_display;
}
4.Clear cache a few times. Now Tablesorter should already start to work. You'll see it when the styling changed.
5.For secondary sort you need to add a small custom JavaScript. In template.php:
/**
* Override or insert variables for the page templates.
*/
function YOUR_THEME_preprocess_page(&$vars) {
// you might define some conditions around here
drupal_add_js(drupal_get_path('theme', 'YOUR_THEME') . '/scripts/custom_tablesort.js');
}
6.In that script write the following to tell Tablesorter to sort the first six collumns of certain tables in ascending alphabetical order. To tell Tablesorter to sort only the second and third column in ascending order write sortList: [[1,0], [2,0]]
instead.
(function ($) {
Drupal.behaviors.tableSorting = {
attach: function (context, settings) {
$("#your_view_name-display_name").tablesorter({
sortList: [[0,0],[1,0],[2,0],[3,0],[4,0],[5,0]]
});
}
}
}) (jQuery);
If you want to let Tablesorter secondary sort all your tables you don't need to define a CSS id when preprocessing and simply tell Tablesorter: $("table").tablesorter({ sortList: [[0,0],[1,0],[2,0],[3,0],[4,0],[5,0]] });
After a little testing I'ld say you leave any custom Tablesorter option out (finish with step 4) and simply explain your users that while holding down shift when clicking multiple headers, secondary sorting works on every desired column they want.