Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for row onClick to SortableTable #366

Merged
merged 2 commits into from
Mar 20, 2018

Conversation

zldavis
Copy link
Contributor

@zldavis zldavis commented Feb 26, 2018

No description provided.

@gthomas-appfolio
Copy link
Contributor

What's the expected behavior when clickable components are inside the cells?

Also, can onClick for each cell suffice?

@zldavis zldavis force-pushed the zdAddRowOnClickToSortedTable branch from 45ddd80 to aea4545 Compare February 26, 2018 19:26
@zldavis
Copy link
Contributor Author

zldavis commented Feb 26, 2018

What's the expected behavior when clickable components are inside the cells?

I'm not sure, I guess you would likely not use this if you had individual clickable components?

Also, can onClick for each cell suffice?

Yes, I guess that would work as well. Are you thinking something like cellOnClick in the column hash and something like

{columns.map(column => <td key={column.key} className={column.align && `text-${column.align}`} onClick={() => column.cellOnClick(row)}>{column.cell(row)}</td>)}

?

@gthomas-appfolio
Copy link
Contributor

Kind of was more just for a one-off usage with current code if someone needs it, otherwise your approach looks preferable. Thanks, will review in depth this afternoon

@gthomas-appfolio gthomas-appfolio merged commit 0fd33e5 into master Mar 20, 2018
@gthomas-appfolio gthomas-appfolio deleted the zdAddRowOnClickToSortedTable branch March 20, 2018 17:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants