Frappe DataTable

A simple, modern and interactive datatable for the web

Format Cells

Show custom formatted cells based on context

Inline Filters

Filter rows based on search text per column

Keyboard Navigation

Full Keyboard Navigation support

Tree Structure

Show tree structured rows in your table

Installation

// Install using yarn
yarn add frappe-datatable

// or npm
npm install frappe-datatable

Usage

    let datatable = new DataTable({
        columns: ['Name', 'Position', ...],
        data: [
            ['Tiger Nixon', 'System Architect', ...],
            ['Garrett Winters', 'Accountant', ...],
            ...
        ]
    })

            

List of configurable options

{
    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
};
View on GitHub
MIT License