Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 25 additions & 0 deletions __tests__/demo/demo-components/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -1165,6 +1165,31 @@ export function TableWithSummary() {
);
}

export function TableWithNumberOfPagesAround() {
const [numberOfPagesAround, setNumberOfPagesAround] = useState(1);

return (
<>
<button onClick={() => setNumberOfPagesAround(numberOfPagesAround + 1)}>
+1
</button>
<button onClick={() => setNumberOfPagesAround(numberOfPagesAround - 1)}>
-1
</button>
<p>Available options: integer from 1 to 10</p>
<p>{`current option: {numberOfPagesAround: ${numberOfPagesAround}, paginationType: "stepped"}`}</p>
<MaterialTable
title="Table with custom amount of pages around current"
columns={columns}
data={rawData}
options={{
numberOfPagesAround: numberOfPagesAround,
paginationType: 'stepped'
}}
/>
</>
);
}
export function FixedColumnWithEdit() {
const [data, setData] = useState([
{ name: 'jack', id: 1 },
Expand Down
6 changes: 6 additions & 0 deletions __tests__/demo/demo.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ import {
DetailPanelRemounting,
TreeData,
TableWithSummary,
TableWithNumberOfPagesAround,
FixedColumnWithEdit
} from './demo-components';
import { I1353, I1941, I122 } from './demo-components/RemoteData';
Expand Down Expand Up @@ -160,6 +161,11 @@ render(
<I122 />
</li>
</ol>
<h1>
Table with custom numbers of pages around current page in stepped
navigation
</h1>
<TableWithNumberOfPagesAround />
<h1>Fixed Column with Row Edits</h1>
<FixedColumnWithEdit />
</div>,
Expand Down
Loading