Quantcast
Viewing all articles
Browse latest Browse all 82132

Bizarre sorting problem with 1.9.4 and jQuery 1.9

I've noticed a weird bug when using custom sorting with dataTables 1.9.4 and jQuery 1.9.

When using the text from the DOM to define the sort order, using something like the following:
$.fn.dataTableExt.afnSortData['dom-text'] = function ( oSettings, iColumn, iVisColumn )
{
    var aData = [];
    $( 'td:eq('+iVisColumn+')', oSettings.oApi._fnGetTrNodes(oSettings) ).each( function () {
      aData.push($(this).text());
    } );
    return aData;
};

..things work fine with jQuery 1.8.2, but seemingly randomly with 1.9.1.

I setup a JSBin here: http://live.datatables.net/ivojev/edit#javascript,html and it works fine, as expected. However if I setup the same environment locally and use jQuery 1.9.1, the sorting on the appropriate content becomes erratic.

Not sure if this is a bug with jQuery 1.9's text method (though the output looks correct) or with the dataTables sorting.. or something in my setup.

Viewing all articles
Browse latest Browse all 82132

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>