Skip to content

Commit

Permalink
51b19797b71eb355e827d02e3be041ed9ec999b7 Fix: Selector row indexes fr…
Browse files Browse the repository at this point in the history
…om the API could be incorrect when server-side processing is enabled

Update api.selectors.js:
Fixes responsive toggle icon only showing on page 1 and not on other pages.
example: https://live.datatables.net/rufivaga/7/edit

Sync to source repo @51b19797b71eb355e827d02e3be041ed9ec999b7
  • Loading branch information
dtbuild committed May 9, 2024
1 parent 2880044 commit d980044
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 3 deletions.
2 changes: 1 addition & 1 deletion datatables.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,5 @@
],
"src-repo": "http://github.com/DataTables/DataTablesSrc",
"last-tag": "2.0.7",
"last-sync": "7060769a9e52d1c4766a799e5e20e43a3bb77e85"
"last-sync": "51b19797b71eb355e827d02e3be041ed9ec999b7"
}
10 changes: 10 additions & 0 deletions js/dataTables.js
Original file line number Diff line number Diff line change
Expand Up @@ -7560,6 +7560,16 @@
order = opts.order, // applied, current, index (original - compatibility with 1.9)
page = opts.page; // all, current

if ( _fnDataSource( settings ) == 'ssp' ) {
// In server-side processing mode, most options are irrelevant since
// rows not shown don't exist and the index order is the applied order
// Removed is a special case - for consistency just return an empty
// array
return search === 'removed' ?
[] :
_range( 0, displayMaster.length );
}

if ( page == 'current' ) {
// Current page implies that order=current and filter=applied, since it is
// fairly senseless otherwise, regardless of what order and search actually
Expand Down
2 changes: 1 addition & 1 deletion js/dataTables.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion js/dataTables.min.mjs

Large diffs are not rendered by default.

10 changes: 10 additions & 0 deletions js/dataTables.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -7507,6 +7507,16 @@ var _selector_row_indexes = function ( settings, opts )
order = opts.order, // applied, current, index (original - compatibility with 1.9)
page = opts.page; // all, current

if ( _fnDataSource( settings ) == 'ssp' ) {
// In server-side processing mode, most options are irrelevant since
// rows not shown don't exist and the index order is the applied order
// Removed is a special case - for consistency just return an empty
// array
return search === 'removed' ?
[] :
_range( 0, displayMaster.length );
}

if ( page == 'current' ) {
// Current page implies that order=current and filter=applied, since it is
// fairly senseless otherwise, regardless of what order and search actually
Expand Down

0 comments on commit d980044

Please sign in to comment.