Sorting football table problem
Sorting football table problem
mattibrd
Posts: 2Questions: 1Answers: 0
I need help about sorting DataTable. I'm making site for football tournaments, and I need to sort table:
1) By points
2) When points are equal for many teams sort by difference between goal scored and lost
3) When upper score are equal sort by only goal scored
Can u help me how to modify that single sorting ?
$('#table').DataTable({
"order":( [[ 4, "desc" ]])
});
This discussion has been closed.
Answers
You need to look at multi-column sorting.
https://datatables.net/examples/basic_init/multi_col_sort.html
I think I would also look into adding a column for "goal difference".
I'm trying to use multisorting, but still I have a trouble. I dont know how to use columns.orderData when i want to sort desc 2 columns when at one I have identical values. Can u show me example of using this?
There are examples showing how to use
columns.orderData
on its documentation page.Allan