Loading ...
Sorry, an error occurred while loading the content.

47231dataTable progressive sorting

Expand Messages
  • colmaengusmurphy
    Apr 1, 2009
      Hi folks,

      It would be nice if the dataTable client sorting supported progressive sorting. By this I mean that if you click on a col to sort by and then click on another col if there are rows with the same value as far as the second col sort is concerned the order is left the same as from the first sort.
      Currently this doesn't happen.
      Looking around the code I see the following (datatable.js 2.7.0)

      sortFnc = sortFnc ||
      function(a, b, desc) {
      var sorted = YAHOO.util.Sort.compare(a.getData(sField),b.getData(sField), desc);
      if(sorted === 0) {
      return YAHOO.util.Sort.compare(a.getCount(),b.getCount(), desc); // Bug 1932978
      else {
      return sorted;

      When I take out the check on sorted and just return sorted hey presto progressive sorting works.

      I can see there is a checkin comment explaining the ref to 1932978

      What I'm wondering is why we need the sub-sort at all ?


      Colm A