Skip to content

Commit

Permalink
Remove XLSX package and code
Browse files Browse the repository at this point in the history
  • Loading branch information
gabrielliwerant committed May 29, 2019
1 parent 61e418e commit 89695bd
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions examples/customize-toolbar-excel-download/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import React from 'react';
import ReactDOM from 'react-dom';
import MUIDataTable from '../../src';
import CustomToolbar from './CustomToolbar';
import XLSX from 'xlsx';

class Example extends React.Component {
constructor(props) {
Expand Down Expand Up @@ -31,14 +30,14 @@ class Example extends React.Component {
const sheetHeader = [visibleColumns.map(col => col.label)];
const finalData = sheetHeader.concat(filteredData);
console.log(finalData);

const workbook = XLSX.utils.book_new();
const worksheet = XLSX.utils.aoa_to_sheet(finalData);
XLSX.utils.book_append_sheet(workbook, worksheet);
XLSX.writeFile(workbook, `download.xlsx`);
}
};

/** onTableInit gives access to initial MuiDataTable state
* if the application needs access to internal state prior to
* the user performing a table mutation (sort, filter, etc.)
* that triggers onTableChange
*/
handleTableInit = (action, tableState) => {
console.log('handleTableInit: ', tableState);
this.tableState = tableState;
Expand Down

0 comments on commit 89695bd

Please sign in to comment.