Skip to content

Commit

Permalink
Fix: When columns were hidden and a class name was used as the column…
Browse files Browse the repository at this point in the history
… selector for AutoFill, the indexing could get confused resulting in a Javascript error.

- Thread 38757
  • Loading branch information
Allan Jardine committed Nov 9, 2016
1 parent 3042a11 commit 69326f5
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion js/dataTables.autoFill.js
Original file line number Diff line number Diff line change
Expand Up @@ -320,14 +320,15 @@ $.extend( AutoFill.prototype, {
row: dt.rows( { page: 'current' } ).nodes().indexOf( endCell.parent()[0] ),
column: endCell.index()
};
var colIndx = dt.column.index( 'toData', end.column );

// Be sure that is a DataTables controlled cell
if ( ! dt.cell( endCell ).any() ) {
return;
}

// if target is not in the columns available - do nothing
if ( dt.columns( this.c.columns ).indexes().indexOf( end.column ) === -1 ) {
if ( dt.columns( this.c.columns ).indexes().indexOf( colIndx ) === -1 ) {
return;
}

Expand Down

0 comments on commit 69326f5

Please sign in to comment.