Skip to content

Commit

Permalink
feat(TableV2): expose initial pageIndex and pageSize (#61)
Browse files Browse the repository at this point in the history
  • Loading branch information
rianmandala authored Oct 17, 2024
1 parent 43e1fd4 commit e80fc7f
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions packages/apsara-ui/src/TableV2/Table.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ interface ITableProps {
isLoading?: boolean;
height?: string;
enableRowSelection?: boolean;
initialPageSize?: number;
initialPageIndex?: number;
}

function Table({
Expand All @@ -54,6 +56,8 @@ function Table({
alternate = false,
alternateHover = false,
enableRowSelection = false,
initialPageIndex = 1,
initialPageSize = 100,
}: ITableProps) {
const columns: any[] = [];
const columnHelper = createColumnHelper();
Expand All @@ -69,8 +73,8 @@ function Table({

const [sorting, setSorting] = React.useState<SortingState>([]);
const [{ pageIndex, pageSize }, setPagination] = React.useState<PaginationState>({
pageIndex: 1,
pageSize: 100,
pageIndex: initialPageIndex,
pageSize: initialPageSize,
});

const fetchDataOptions = {
Expand Down

0 comments on commit e80fc7f

Please sign in to comment.