Skip to content

Latest commit

 

History

History
26 lines (21 loc) · 914 Bytes

USING_CUSTOM_PAGER.md

File metadata and controls

26 lines (21 loc) · 914 Bytes

Using a Custom Pager

You can pass a JSX element to replace the pager entirely. This can be either a connected or unconnected component. To dispatch paging events, you can use the Actions.PagerActions.setPageIndexAsync or Actions.PagerActions.setPage that are exposed from the main export.

Example:

// my custom actionHandler that my custom component uses

export const setPageIndex = (pageIndex, pageSize, dataSource) => {
    return (dispatch) => {
        // dispatch an event that the grid is listening for, which updates the current records
        dispatch(
            Actions.PagerActions
                .setPageIndexAsync(pageIndex, pageSize, dataSource)
        );

        // dispatch an event that my custom toolbar is listening for
        // to update the current pageIndex
        dispatch({
            type: SET_PAGE_INDEX,
            pageIndex
        });

    };
};