GridColumnMenuFilter

A subclass of React.Component.

class TextColumnMenu extends React.Component {
    render() {
        return (
        <div>
            <GridColumnMenuSort {...this.props} />
            <GridColumnMenuFilter {...this.props} />
        </div>);
    }
}

class App extends React.PureComponent {
    constructor(props) {
        super(props);

        this.state = this.createAppState({
            take: 10,
            skip: 0
        });
    }

    createAppState(dataState) {
        return {
            result: process(products.slice(0), dataState),
            dataState: dataState
        };
    }

    dataStateChange = (event) => {
        this.setState(this.createAppState(event.data));
    }

    render() {
        return (
            <div>
                <Grid
                    data={this.state.result}
                    {...this.state.dataState}
                    onDataStateChange={this.dataStateChange}
                    sortable={true}
                    pageable={true}
                >
                    <Column field="ProductID" title="Product ID" />
                    <Column field="ProductName" columnMenu={TextColumnMenu} />
                </Grid>
                <br />
            </div>
        );
    }
}

ReactDOM.render(<App />, document.querySelector('my-app'));

props Readonly<GridColumnMenuFilterProps> intersected with Readonly<{ children?: ReactNode; }>

The props of the GridColumnMenuFilter component.

Methods

active

Can be used to check if filtering is applied to a specific field (see example). Useful for creating active filter indicators.

Parameters

field string
filter? CompositeFilterDescriptor

Returns

boolean

 /