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

Redundant calls in Table. #954

Closed
wants to merge 3 commits into from
Closed

Redundant calls in Table. #954

wants to merge 3 commits into from

Conversation

mkucharz
Copy link
Contributor

Those calls are redundant, with them onRowSelection and onCellClick are executed multiple times.

@jkruder
Copy link
Contributor

jkruder commented Jun 26, 2015

@mkucharz You're right. I skipped over the table-row onClick handler. The original intent was to not have handlers on both the row and the cells -- looks like I never went back to update the table-row. I suspect that the number of rows will be orders of magnitude smaller than the number of cells so there may not be much benefit to removing the onClick handler in table-row and calling the _handleRowClick from _handleCellClick. Thoughts?

@mkucharz
Copy link
Contributor Author

@jkruder In general I think the most useful and universal way to solve it is to combine those two calls - always send in addition cell name. You can always get it's number from columnOrder. Same thing with hover events - at least it is inline with our needs. Basically every cellClick is also a rowClick... Do you see any other usage or reason to distinguish them that way?

@jkruder
Copy link
Contributor

jkruder commented Jun 26, 2015

@mkucharz I like the separation of the two events; your handlers are going to be doing one type of processing as opposed to containing logic to handle row events and then handle cell events. Personal preference. If we do stick with separate row/cell events I would like to remove the separate click handler on the table-row and just leverage the cell event.

@hai-cea Any preference as to how we handle row vs cell events?

@mkucharz
Copy link
Contributor Author

@jkruder sounds good, I'm ok with your idea.

@hai-cea
Copy link
Member

hai-cea commented Jun 26, 2015

@jkruder Doesn't the cell click event automatically bubble up to the row? It would seem that manually calling onRowClick inside onCellClick unnecessary because of event bubbling.

@jkruder
Copy link
Contributor

jkruder commented Jun 27, 2015

@hai-cea I would remove the click handler from the row entirely. No point in registering a handler on the row if we have them on each cell. So I would modify this PR so that the click event on the table-row is removed and the click event on the cell is propagated to the row inside table-row.

@hai-cea
Copy link
Member

hai-cea commented Jun 27, 2015

Sounds good 👍

@jkruder
Copy link
Contributor

jkruder commented Jul 2, 2015

@mkucharz Do you have a status update on this?

@jkruder
Copy link
Contributor

jkruder commented Jul 9, 2015

Resolved in #1087

@jkruder jkruder closed this Jul 9, 2015
@zannager zannager added the component: table This is the name of the generic UI component, not the React module! label Mar 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: table This is the name of the generic UI component, not the React module!
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants