New to KendoReact? Start a free 30-day trial

Definition

Package:@progress/kendo-react-grid

Properties Interface:GridColumnMenuSortProps

Syntax:

jsx
const ColumnMenu = (props) => {
    return (
        <div>
            <GridColumnMenuSort {...props} />
        </div>
    );
};

const initialState = {
    take: 10,
    skip: 0
};

const App = () => {
    const [dataState, setDataState] = useState(initialState);
    const [result, setResult] = useState(process(products.slice(0), initialState));

    const dataStateChange = (event) => {
        setDataState(event.dataState);
        setResult(process(products.slice(0), event.dataState));
    };

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

export default App;

Properties

The current column options.

onCloseMenu?

Function

The method that will be called to close the column menu.

onSortChange?

(descriptors: SortDescriptor[], e: SyntheticEvent​<any, Event>) => void

The method that will be called to notify the parent Grid about a sort change.

Parameters:descriptorsSortDescriptor[]eSyntheticEvent​<any, Event>

sort?

SortDescriptor[]

The current sort state of the Grid. It takes a value of type SortDescriptor[]

sortable?

SortSettings

The sortable option of the column.