Skip to content

Commit

Permalink
2a5b9b9791b7711947ef823455e580c9c96f3816 Fix: -type column-selector
Browse files Browse the repository at this point in the history
… when used as a function was not being passed the column header cell as the third parameter.

DataTables/Buttons#201

Sync to source repo @2a5b9b9791b7711947ef823455e580c9c96f3816
  • Loading branch information
dtbuild committed Apr 11, 2024
1 parent 798b1a0 commit baceca1
Show file tree
Hide file tree
Showing 5 changed files with 33 additions and 23 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.3",
"last-sync": "e4cc703c2453265dc2151f17f5d6824735ce2e20"
"last-sync": "2a5b9b9791b7711947ef823455e580c9c96f3816"
}
25 changes: 15 additions & 10 deletions js/dataTables.js
Original file line number Diff line number Diff line change
Expand Up @@ -8236,6 +8236,17 @@
};


var __column_header = function ( settings, column, row ) {
var header = settings.aoHeader;
var target = row !== undefined
? row
: settings.bSortCellsTop // legacy support
? 0
: header.length - 1;

return header[target][column].cell;
};

var __column_selector = function ( settings, selector, opts )
{
var
Expand Down Expand Up @@ -8268,7 +8279,8 @@
return columns.map(function (col, idx) {
return s(
idx,
__columnData( settings, idx, 0, 0, rows )
__columnData( settings, idx, 0, 0, rows ),
__column_header( settings, idx )
) ? idx : null;
});
}
Expand Down Expand Up @@ -8413,15 +8425,8 @@
} );

_api_registerPlural( 'columns().header()', 'column().header()', function ( row ) {
return this.iterator( 'column', function ( settings, column ) {
var header = settings.aoHeader;
var target = row !== undefined
? row
: settings.bSortCellsTop // legacy support
? 0
: header.length - 1;

return header[target][column].cell;
return this.iterator( 'column', function (settings, column) {
return __column_header(settings, column, row);
}, 1 );
} );

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.

25 changes: 15 additions & 10 deletions js/dataTables.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -8183,6 +8183,17 @@ var __columnData = function ( settings, column, r1, r2, rows, type ) {
};


var __column_header = function ( settings, column, row ) {
var header = settings.aoHeader;
var target = row !== undefined
? row
: settings.bSortCellsTop // legacy support
? 0
: header.length - 1;

return header[target][column].cell;
};

var __column_selector = function ( settings, selector, opts )
{
var
Expand Down Expand Up @@ -8215,7 +8226,8 @@ var __column_selector = function ( settings, selector, opts )
return columns.map(function (col, idx) {
return s(
idx,
__columnData( settings, idx, 0, 0, rows )
__columnData( settings, idx, 0, 0, rows ),
__column_header( settings, idx )
) ? idx : null;
});
}
Expand Down Expand Up @@ -8360,15 +8372,8 @@ _api_register( 'columns()', function ( selector, opts ) {
} );

_api_registerPlural( 'columns().header()', 'column().header()', function ( row ) {
return this.iterator( 'column', function ( settings, column ) {
var header = settings.aoHeader;
var target = row !== undefined
? row
: settings.bSortCellsTop // legacy support
? 0
: header.length - 1;

return header[target][column].cell;
return this.iterator( 'column', function (settings, column) {
return __column_header(settings, column, row);
}, 1 );
} );

Expand Down

0 comments on commit baceca1

Please sign in to comment.