Multi column sorting issue

Multi column sorting issue

nruscittonruscitto Posts: 2Questions: 0Answers: 0
edited March 2014 in General
Hi all

So I am having an issue with multi-column sorting. I have a table of resources and I want to sort first by the resource type (alphabetically) and then by the distance (closest first). The resource type column is getting sorted but the distance is not. I modeled my code after the example and can't seem to find anything wrong. This is on a salesforce platform by the way.

Here is the code:

[code]
$(".tablesorterJob").dataTable( {
"bSort": true,
"aaSorting": [[1,'asc'], [5,'asc']],
"sScrollY": "200px",
"sScrollX": "100%",
"bAutoWidth": true,
"aoColumnDefs": [
{ "sWidth": "30px", "aTargets": [ 0 ]},
{ "sType": "string-case", "aTargets": [ 5 ]}
],
"bPaginate": true,
"bJQueryUI": true,
"iDisplayLength": 10,
"bLengthChange": false
} );
[/code]

Could this be an issue with the different types of data that I am trying to sort?

Resource type is column 1 with type string and distance is column 5 of type number.

Thanks in advance
Nick

Replies

  • allanallan Posts: 63,498Questions: 1Answers: 10,471 Site admin
    Multi-column sorting will operate regardless of the different column types. As long as your column sorts individually (does it?) then it should also work correctly as part of a multiple column sort.

    Beyond that we would need a test case showing the problem.

    Allan
  • nruscittonruscitto Posts: 2Questions: 0Answers: 0
    That's just it - I can sort each column individually without issue. When I try to sort multiple columns ('shift' clicking additional columns) nothing happens. I don't know if I can provide any further code since this is part of a client project.
  • allanallan Posts: 63,498Questions: 1Answers: 10,471 Site admin
    I'm afraid there is very little I can do to offer any help in that case, since my demos appear to work okay for this use case.

    Allan
This discussion has been closed.