Skip to content

Commit

Permalink
chore: virtulized selectable demo
Browse files Browse the repository at this point in the history
  • Loading branch information
tewarig committed Jan 12, 2025
1 parent 083a1b3 commit 7d2dd2b
Showing 1 changed file with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ export default {
} as Meta<TableProps<unknown>>;

const nodes: Item[] = [
...Array.from({ length: 50 }, (_, i) => ({
...Array.from({ length: 400 }, (_, i) => ({
id: (i + 1).toString(),
paymentId: `rzp${Math.floor(Math.random() * 1000000)}`,
amount: Number((Math.random() * 10000).toFixed(2)),
Expand Down Expand Up @@ -193,8 +193,13 @@ export const NormalTable: StoryFn<typeof TableComponent> = ({ ...args }) => {
defaultSelectedIds={['1', '3']}
onSelectionChange={console.log}
isFirstColumnSticky
selectionType="single"
height="100%"
selectionType="multiple"
// eslint-disable-next-line react/jsx-no-duplicate-props
onSelectionChange={({ selectedIds }) => {
console.log(selectedIds);
// setSelectedItems(data.nodes.filter((node) => selectedIds.includes(node.id)));
}}
toolbar={
<TableToolbar title="Showing 1-10 [Items]" selectedTitle="Showing 1-10 [Items]">
<TableToolbarActions>
Expand Down

0 comments on commit 7d2dd2b

Please sign in to comment.