Sorting row with ranking info
Sorting row with ranking info
ladless
Posts: 2Questions: 0Answers: 0
Hello there,
I was wondering why my sorting isn't working as expected ("normal" sort):
Now I get:
8th
8th
7th
4th
3rd
2nd
22nd
20th
Instead I need to get:
22nd
20th
8th
7th
... you get the picture.
So far I have this code:
[code]if (TournamentManager.page_size != 0) {
$("table.tournamentmanager").each(function(i) {
var col = 0;
var dir = 'asc';
/* If the table has the attribute default_sort="2:desc" */
var default_sort = $(this).attr('default_sort');
if (default_sort != undefined) {
var val = default_sort.split(':');
col = val[0];
dir = val[1];
}
$(this).dataTable({
"iDisplayLength":TournamentManager.page_size,
"aaSorting": [[ col, dir]]
});
});
}[/code]
I tried some snippets but it doesn't work... Also did some research on the custom sorting plugins and it looks like they can do way much more than I need to. I'm sure there is a simpler approach to this.
Any help would be kindly appreciated !
Thanks.
I was wondering why my sorting isn't working as expected ("normal" sort):
Now I get:
8th
8th
7th
4th
3rd
2nd
22nd
20th
Instead I need to get:
22nd
20th
8th
7th
... you get the picture.
So far I have this code:
[code]if (TournamentManager.page_size != 0) {
$("table.tournamentmanager").each(function(i) {
var col = 0;
var dir = 'asc';
/* If the table has the attribute default_sort="2:desc" */
var default_sort = $(this).attr('default_sort');
if (default_sort != undefined) {
var val = default_sort.split(':');
col = val[0];
dir = val[1];
}
$(this).dataTable({
"iDisplayLength":TournamentManager.page_size,
"aaSorting": [[ col, dir]]
});
});
}[/code]
I tried some snippets but it doesn't work... Also did some research on the custom sorting plugins and it looks like they can do way much more than I need to. I'm sure there is a simpler approach to this.
Any help would be kindly appreciated !
Thanks.
This discussion has been closed.
Replies
Allan