Skip to content

Commit a8d0707

Browse files
author
Allan Jardine
committed
Fix: A bug in DataTables was causing the cell selector to fail on any but the first page. A workaround has been used here to address this until DataTables core has been updated.
1 parent 9b33800 commit a8d0707

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

js/dataTables.autoFill.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -367,7 +367,8 @@ $.extend( AutoFill.prototype, {
367367
start.column
368368
};
369369
var colIndx = dt.column.index( 'toData', end.column );
370-
var endCell = $( dt.cell( ':eq('+end.row+')', colIndx ).node() );
370+
var endRow = dt.row( ':eq('+end.row+')', { page: 'current' } ); // Workaround for M581
371+
var endCell = $( dt.cell( endRow.index(), colIndx ).node() );
371372

372373
// Be sure that is a DataTables controlled cell
373374
if ( ! dt.cell( endCell ).any() ) {
@@ -757,7 +758,8 @@ $.extend( AutoFill.prototype, {
757758
for ( var rowIdx=0 ; rowIdx<rows.length ; rowIdx++ ) {
758759
selected.push(
759760
$.map( columns, function (column) {
760-
var cell = dt.cell( ':eq('+rows[rowIdx]+')', column+':visible', {page:'current'} );
761+
var row = dt.row( ':eq('+rows[rowIdx]+')', {page:'current'} ); // Workaround for M581
762+
var cell = dt.cell( row.index(), column+':visible' );
761763
var data = cell.data();
762764
var cellIndex = cell.index();
763765
var editField = dtColumns[ cellIndex.column ].editField;

0 commit comments

Comments
 (0)