/* Sort immediately with columns 0 and 1 */
oTable.fnSort( [ [0,'asc'], [1,'asc'] ] );
} );
[/code]
---------------
DT allows you to associate a different column with a given column, but this only works with a single column, unfortunately (as far as I know)
http://www.datatables.net/ref#iDataSort
maybe Allan can expand iDataSort to allow an object array like fnSort? You're at least the 2nd person to ask this question in the past month. And it would be easier to specify iDataSort than to catch the column header click.
Thanks for your response. I am able to solve my problem by using only one hidden column generated on the server side. However, your suggestion to adapt iDataSort to take an array of columns to support multi-column sorting would be a nice addition to this great API.
Replies
[code]
var oTable;
$(document).ready(function() {
oTable = $('#example').dataTable();
/* Sort immediately with columns 0 and 1 */
oTable.fnSort( [ [0,'asc'], [1,'asc'] ] );
} );
[/code]
---------------
DT allows you to associate a different column with a given column, but this only works with a single column, unfortunately (as far as I know)
http://www.datatables.net/ref#iDataSort
maybe Allan can expand iDataSort to allow an object array like fnSort? You're at least the 2nd person to ask this question in the past month. And it would be easier to specify iDataSort than to catch the column header click.
Allan