Add customizing size of pagination
This commit is contained in:
parent
7eeb60539f
commit
accd3692c5
@ -1,8 +1,17 @@
|
|||||||
import React from "react";
|
import React from "react";
|
||||||
import { Datagrid, List, TextField } from "react-admin";
|
import { Datagrid, List, TextField, Pagination } from "react-admin";
|
||||||
|
|
||||||
|
const RoomPagination = props => (
|
||||||
|
<Pagination
|
||||||
|
{...props}
|
||||||
|
rowsPerPageOptions={[10, 25, 50, 100, 500, 1000]}
|
||||||
|
/>);
|
||||||
|
|
||||||
export const RoomList = props => (
|
export const RoomList = props => (
|
||||||
<List {...props}>
|
<List
|
||||||
|
{...props}
|
||||||
|
pagination={<RoomPagination />}
|
||||||
|
>
|
||||||
<Datagrid>
|
<Datagrid>
|
||||||
<TextField source="room_id" />
|
<TextField source="room_id" />
|
||||||
<TextField source="name" />
|
<TextField source="name" />
|
||||||
|
|||||||
@ -14,8 +14,15 @@ import {
|
|||||||
TextInput,
|
TextInput,
|
||||||
ReferenceField,
|
ReferenceField,
|
||||||
regex,
|
regex,
|
||||||
|
Pagination
|
||||||
} from "react-admin";
|
} from "react-admin";
|
||||||
|
|
||||||
|
const UserPagination = props => (
|
||||||
|
<Pagination
|
||||||
|
{...props}
|
||||||
|
rowsPerPageOptions={[10, 25, 50, 100, 500, 1000]}
|
||||||
|
/>);
|
||||||
|
|
||||||
const UserFilter = props => (
|
const UserFilter = props => (
|
||||||
<Filter {...props}>
|
<Filter {...props}>
|
||||||
<BooleanInput source="guests" alwaysOn />
|
<BooleanInput source="guests" alwaysOn />
|
||||||
@ -33,6 +40,7 @@ export const UserList = props => (
|
|||||||
filters={<UserFilter />}
|
filters={<UserFilter />}
|
||||||
filterDefaultValues={{ guests: true, deactivated: false }}
|
filterDefaultValues={{ guests: true, deactivated: false }}
|
||||||
bulkActionButtons={false}
|
bulkActionButtons={false}
|
||||||
|
pagination={<UserPagination />}
|
||||||
>
|
>
|
||||||
<Datagrid rowClick="edit">
|
<Datagrid rowClick="edit">
|
||||||
<ReferenceField
|
<ReferenceField
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user