Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

$.fn.dataTableExt.afnSortData does not work with jQuery 1.9.x #161

Closed
CILLERt opened this Issue · 1 comment

2 participants

@CILLERt

Since jQuery 1.9 the $.fn.dataTableExt.afnSortData results in random search results with strings. Numbers do work in some cases but in most cases also don't.

found this topic: http://datatables.net/forums/discussion/14316/bizarre-sorting-problem-with-1.9.4-and-jquery-1.9

Which solved my issue for now. Lets see who has to fix it, But maybe change the documentation about afnSortData to make it clearer for other users.

@DataTables
Owner

Agreed - I think the DataTables documentation certainly needs to be updated, regardless of any changes in jQuery.

@DataTables DataTables closed this issue from a commit
@DataTables Fix #161: DOM sorting plug-ins updated
- Cope with the change in jQuery 1.9 for element ordering. From the
  DataTables thread on this topic ( 14316 ):

So a bit of further investigation into this - I've used these two test
caseS:

No DataTables: http://live.datatables.net/uwidel/edit#source
DataTables: http://live.datatables.net/ivojev/4/edit

The new DataTables version shows that jQuery 1.9 is now always trying to
order the nodes by document order, not but the order that they are found
in the source array. Additionally removed nodes are appended to the
results, themselves in reserve order, but that's just the way the Sizzle
node ordering works when items are not in the document (try sorting
numbers and you get the same result).

Given the suggestion in the release notes that the move is to have nodes
always treated in document order, I don't think this is a bug, so not
filing one. It is a bit frustrating that the nodes are iterated in a
different order from the source array, but it is expected from their
documentation and comments. So this is simply something we'll need to
work around.

To that end, I've updated the examples and taken the unusual step of
updating the examples on this site outside the normal release cycle. The
examples in the 1.9.4 current release of DataTables can't change of
course, but the updated examples will be in 1.10 when it is released.
e00037a
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.