-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
allow clicking table row to invoke callback
- Loading branch information
1 parent
59dfc14
commit 42e3966
Showing
2 changed files
with
25 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,25 +13,26 @@ type Story = StoryObj<typeof Table> | |
export const FullTable: Story = { | ||
decorators: [(Story) => <Story />], | ||
args: { | ||
onRowClick: (id) => console.log("table row clicked", id), | ||
data: [ | ||
{ | ||
uid: "", | ||
uid: "John", | ||
Name: "John Doe", | ||
Email: "[email protected]", | ||
Status: "Member", | ||
"Membership type": "UOA Student", | ||
"Date Joined": "12-7-22" | ||
}, | ||
{ | ||
uid: "", | ||
uid: "Straight Zhao", | ||
Name: "Ray Zhao", | ||
Email: "[email protected]", | ||
Status: "Superior Controller", | ||
"Membership type": "UOA Student", | ||
"Date Joined": "12-7-22" | ||
}, | ||
{ | ||
uid: "", | ||
uid: "Doeshin", | ||
Name: "Johnathan Doeshin", | ||
Email: "[email protected]", | ||
Status: "Member", | ||
|
@@ -134,6 +135,7 @@ export const MultipleOperations = () => { | |
<p>Last deleted id: {deleteMessage}</p> | ||
<Table<(typeof data)[0], "multiple-operations"> | ||
data={data} | ||
onRowClick={() => alert("Row Callback")} | ||
operationType="multiple-operations" | ||
rowOperations={[ | ||
{ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters