diff --git a/.datatables-commit-sync b/.datatables-commit-sync index 9f1b2875..b8d59f34 100644 --- a/.datatables-commit-sync +++ b/.datatables-commit-sync @@ -1 +1 @@ -c03c559f0b0a8a815ab1dab80fe72d6806ce78a5 +9cb6d52a9a3e57a2327bc987d905ef8a55a3846b diff --git a/examples/api/counter_columns.html b/examples/api/counter_columns.html index f9274409..67928047 100644 --- a/examples/api/counter_columns.html +++ b/examples/api/counter_columns.html @@ -29,7 +29,7 @@ $(document).ready(function() { } ); t.on( 'order search', function () { - t.column(0, {filter:'applied', order:'applied'}).nodes().each( function (cell, i) { + t.column(0, {search:'applied', order:'applied'}).nodes().each( function (cell, i) { cell.innerHTML = i+1; } ); } ).draw(); @@ -567,7 +567,7 @@ $(document).ready(function() { } ); t.on( 'order search', function () { - t.column(0, {filter:'applied', order:'applied'}).nodes().each( function (cell, i) { + t.column(0, {search:'applied', order:'applied'}).nodes().each( function (cell, i) { cell.innerHTML = i+1; } ); } ).draw(); diff --git a/media/js/jquery.dataTables.js b/media/js/jquery.dataTables.js index 74a1c553..422c90f6 100644 --- a/media/js/jquery.dataTables.js +++ b/media/js/jquery.dataTables.js @@ -7137,8 +7137,14 @@ opts = {}; } + // Backwards compatibility for 1.9- which used the terminology filter rather + // than search + if ( opts.filter && ! opts.search ) { + opts.search = opts.filter; + } + return { - filter: opts.filter || 'none', + search: opts.search || 'none', order: opts.order || 'current', page: opts.page || 'all' }; @@ -7174,12 +7180,12 @@ displayMaster = settings.aiDisplayMaster; var - filter = opts.filter, // none, applied, removed - order = opts.order, // current, index (original - compatibility with 1.9) - page = opts.page; // all, page + search = opts.search, // none, applied, removed + order = opts.order, // applied, current, index (original - compatibility with 1.9) + page = opts.page; // all, current // Current page implies that order=current and fitler=applied, since it is - // fairly senseless otherwise, regardless of what order and filter actually + // fairly senseless otherwise, regardless of what order and search actually // are if ( page == 'current' ) { @@ -7188,24 +7194,24 @@ } } else if ( order == 'current' || order == 'applied' ) { - a = filter == 'none' ? - displayMaster.slice() : // no filter - filter == 'applied' ? - displayFiltered.slice() : // applied filter - $.map( displayMaster, function (el, i) { // removed filter + a = search == 'none' ? + displayMaster.slice() : // no search + search == 'applied' ? + displayFiltered.slice() : // applied search + $.map( displayMaster, function (el, i) { // removed search return $.inArray( el, displayFiltered ) === -1 ? el : null; } ); } else if ( order == 'index' || order == 'original' ) { for ( i=0, ien=settings.aoData.length ; i