Skip to content

Commit

Permalink
Fix: AutoFilter merge should only be done if auto filter is enabled
Browse files Browse the repository at this point in the history
- Fixes #160
  • Loading branch information
AllanJard committed Jan 9, 2019
1 parent 5ee6d41 commit 88c0551
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions js/buttons.html5.js
Expand Up @@ -1212,19 +1212,19 @@ DataTable.ext.buttons.excelHtml5 = {
} ) );
}

// Auto filter for columns
$('mergeCells', rels).before( _createNode( rels, 'autoFilter', {
attr: {
ref: 'A'+dataStartRow+':'+createCellPos(data.header.length-1)+dataEndRow
}
} ) );

// Workbook modifications
var workbook = xlsx.xl['workbook.xml'];

$( 'sheets sheet', workbook ).attr( 'name', _sheetname( config ) );

// Auto filter for columns
if ( config.autoFilter ) {
$('mergeCells', rels).before( _createNode( rels, 'autoFilter', {
attr: {
ref: 'A'+dataStartRow+':'+createCellPos(data.header.length-1)+dataEndRow
}
} ) );

$('definedNames', workbook).append( _createNode( workbook, 'definedName', {
attr: {
name: '_xlnm._FilterDatabase',
Expand Down

0 comments on commit 88c0551

Please sign in to comment.