# Install using yarn
$ yarn add frappe-datatable
# or npm
$ npm install frappe-datatable
import DataTable from 'frappe-datatable';
// or add
// <script src="frappe-datatable.js" ></script>
// in your html
let datatable = new DataTable({
columns: ['Name', 'Position', ...],
data: [
['Tiger Nixon', 'System Architect', ...],
['Garrett Winters', 'Accountant', ...],
...
]
});
{
columns: [],
data: [],
dropdownButton: '▼',
headerDropdown: [
{
label: 'Custom Action',
action: console.log
}
],
events: {
onRemoveColumn(column) {
},
onSwitchColumn(column1, column2) {
},
onSortColumn(column) {
}
},
sortIndicator: {
asc: '↑',
desc: '↓',
none: ''
},
freezeMessage: '',
getEditor: () => {
},
addSerialNoColumn: true,
addCheckboxColumn: false,
enableClusterize: true,
enableLogs: false,
layout: 'fixed', // fixed, fluid
noDataMessage: 'No Data',
cellHeight: null,
enableInlineFilters: false
}
MIT License