How to use the dash-table/components/Table/props.TableAction.Custom function in dash-table

To help you get started, we’ve selected a few dash-table examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github plotly / dash-table / tests / visual / percy-storybook / TriadValidation.percy.tsx View on Github external
import React from 'react';
import { storiesOf } from '@storybook/react';

import DataTable from 'dash-table/dash/DataTable';
import { TableAction } from 'dash-table/components/Table/props';

const actions = [TableAction.Native, TableAction.Custom];

const setProps = () => { };

let stories = storiesOf('DashTable/Props Validation', module);

actions.forEach(filter => {
    actions.forEach(sort => {
        actions.forEach(page => {
            stories = stories.add(`filter=${filter}, sorting=${sort}, pagination=${page}`, () => ());
        });
    });
github plotly / dash-table / src / dash-table / components / ControlledTable / index.tsx View on Github external
get displayPagination() {
        const {
            data,
            page_action,
            page_size
        } = this.props;

        return (
            page_action === TableAction.Native &&
            page_size < data.length
        ) || page_action === TableAction.Custom;
    }
github plotly / dash-table / src / dash-table / derived / paginator.ts View on Github external
const getter = (
    page_action: TableAction,
    page_current: number,
    page_size: number,
    setProps: SetProps,
    data: Data
): IPaginator => {
    switch (page_action) {
        case TableAction.None:
            return getNoPagination();
        case TableAction.Native:
            return getFrontEndPagination(page_current, page_size, setProps, data);
        case TableAction.Custom:
            return getBackEndPagination(page_current, setProps);
        default:
            throw new Error(`Unknown pagination mode: '${page_action}'`);
    }
};
github plotly / dash-table / src / dash-table / dash / validate.ts View on Github external
function isFrontEnd(value: TableAction) {
    return value !== TableAction.Custom;
}
github plotly / dash-table / src / dash-table / derived / data / viewport.ts View on Github external
const getter = (
    page_action: TableAction,
    page_current: number,
    page_size: number,
    data: Data,
    indices: Indices
): IDerivedData => {
    switch (page_action) {
        case TableAction.None:
            return getNoPagination(data, indices);
        case TableAction.Native:
            return getFrontEndPagination(page_current, page_size, data, indices);
        case TableAction.Custom:
            return getBackEndPagination(data, indices);
        default:
            throw new Error(`Unknown pagination mode: '${page_action}'`);
    }
};