From 3ea905201b815aaff11705f04f2ff784249114a6 Mon Sep 17 00:00:00 2001 From: Allan Jardine Date: Tue, 27 May 2014 15:42:20 +0100 Subject: [PATCH] Fix: Custom filter was running through the rows in reverse * Originally this was done because it makes removing items a little bit easier with Array.splice(), however, it doesn't make any sense to go through the rows in reverse if there might be an interdependency between the rows. * It has never been documented what order the rows are filtered in, so I think this is a safe change to make. * I've also added the row display index to the parameters passed in --- .datatables-commit-sync | 2 +- media/js/jquery.dataTables.js | 16 ++++++++++++---- 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/.datatables-commit-sync b/.datatables-commit-sync index 2db3e55e..f60f8ec0 100644 --- a/.datatables-commit-sync +++ b/.datatables-commit-sync @@ -1 +1 @@ -014b64c0781cdf68073d51d5ca8e46a45425bbbd +f07529f7ddf780f9668356727be62df70b3da153 diff --git a/media/js/jquery.dataTables.js b/media/js/jquery.dataTables.js index 983f6cdd..b645813b 100644 --- a/media/js/jquery.dataTables.js +++ b/media/js/jquery.dataTables.js @@ -2767,15 +2767,23 @@ var displayRows = settings.aiDisplay; var row, rowIdx; - for ( var i=0, iLen=filters.length ; i=0 ; j-- ) { + for ( var i=0, ien=filters.length ; i