Preserve multi-column sort when sorting?
Preserve multi-column sort when sorting?
daan.timmer
Posts: 4Questions: 0Answers: 0
Right, I've got a table that looks like this:
[col0 (name)] - [col1 (key)] - [some more] - [col7 (order)]
I initialise the table using:
[code]var faq = {
table : null,
init : function( ){
faq.table = $("table.display").dataTable({
sPaginationType: "full_numbers",
iDisplayLength: 25,
bStateSave: true,
"oLanguage": {
"sUrl": "/jquery/addons/datatable/lang/{\literal}{$language}{literal}"
},
"aaSorting" : [[0,"asc"], [1,"asc"], [7, "asc"]],
"aoColumns" : [
null, //0
null, //1
{"bSortable" : false}, //2
{"bSortable" : false}, //3
{"bSortable" : false}, //4
{"bSortable" : false}, //5
{"bSortable" : false}, //6
null, //7
{"bSortable" : false}, //8
]
});
}
}[/code]
I would like column 0 to be the "first/master" sort column, column 1 should be second and 7th column should be 3th.
However, atm, when you click on, say column 7, column 0 and 1 will be un-sorted, which I don't want to happen. Sorting on column 7 should also keep on sorting column 0 and 1.
I know it is supposed to be done by holding shift. But that is not feesable in this situation. It should multi-sort on column0,1,7 shift or not.
I removed most of the "faq" code because it is not needed anyway.
[col0 (name)] - [col1 (key)] - [some more] - [col7 (order)]
I initialise the table using:
[code]var faq = {
table : null,
init : function( ){
faq.table = $("table.display").dataTable({
sPaginationType: "full_numbers",
iDisplayLength: 25,
bStateSave: true,
"oLanguage": {
"sUrl": "/jquery/addons/datatable/lang/{\literal}{$language}{literal}"
},
"aaSorting" : [[0,"asc"], [1,"asc"], [7, "asc"]],
"aoColumns" : [
null, //0
null, //1
{"bSortable" : false}, //2
{"bSortable" : false}, //3
{"bSortable" : false}, //4
{"bSortable" : false}, //5
{"bSortable" : false}, //6
null, //7
{"bSortable" : false}, //8
]
});
}
}[/code]
I would like column 0 to be the "first/master" sort column, column 1 should be second and 7th column should be 3th.
However, atm, when you click on, say column 7, column 0 and 1 will be un-sorted, which I don't want to happen. Sorting on column 7 should also keep on sorting column 0 and 1.
I know it is supposed to be done by holding shift. But that is not feesable in this situation. It should multi-sort on column0,1,7 shift or not.
I removed most of the "faq" code because it is not needed anyway.
This discussion has been closed.
Replies
Allan