-
Notifications
You must be signed in to change notification settings - Fork 380
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
feat(react-grid): support column virtualization #892
Conversation
}; | ||
}); | ||
|
||
export const tableGroupRowCellColSpanGetter = getTableCellColSpan => (params) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
tableGroupRowCellColSpanGetter
Wow!
import * as React from 'react'; | ||
import * as PropTypes from 'prop-types'; | ||
|
||
export class ForwardRef extends React.PureComponent { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This component seems weird. Maybe we can rename it to something more definitive.
&& tableRow.row.groupedBy !== tableColumn.column.name; | ||
export const isGroupIndentTableCell = (tableRow, tableColumn, grouping) => { | ||
if (tableRow.type !== TABLE_GROUP_TYPE || tableColumn.type !== TABLE_GROUP_TYPE) return false; | ||
if (tableRow.row.groupedBy === tableColumn.column.name) return false; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we union this two conditions?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, we can. But the row will be too long. We will need to split it.
@@ -57,13 +59,19 @@ export class Table extends React.PureComponent { | |||
<Getter name="tableHeaderRows" value={tableHeaderRows} /> | |||
<Getter name="tableBodyRows" computed={tableBodyRowsComputed} /> | |||
<Getter name="tableColumns" computed={tableColumnsComputed} /> | |||
<Getter name="getTableCellColSpan" value={tableCellColSpanGetter} /> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This getter is not described in docs
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is conceived. I am not sure that it is the final realization of the colSpan API. So, it's better to hide it from docs.
{collapsedGrid.rows.map((visibleRow) => { | ||
if (visibleRow.type === 'stub') { | ||
return ( | ||
<tr key={visibleRow.key} style={{ height: `${visibleRow.height}px` }} /> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we shouldn't use html tags(tr
, td
) in this package. The same about Sizer
. It's built with the div
tags and placed in core package.
{cells.map((cell) => { | ||
if (cell.type === 'stub') { | ||
return ( | ||
<td |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The same here.
@@ -30,3 +29,11 @@ export const tableColumnsWithDetail = (tableColumns, toggleColumnWidth) => [ | |||
{ key: TABLE_DETAIL_TYPE, type: TABLE_DETAIL_TYPE, width: toggleColumnWidth }, | |||
...tableColumns, | |||
]; | |||
|
|||
export const tableDetailRowCellColSpanGetter = getTableCellColSpan => (params) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we make this name shorter, e.g. 'tableDetailCellColSpanGetter'?
No description provided.