Replies: 3 comments 3 replies
-
The way we thought this is that
but we clearly failed to document it properly and explain it thoroughly. To be honest, at runtime people are not very likely to switch the group rendering strategy. If you think of a better way to specify this or a better API, let us know as we're keen to consider any improvements we can make. |
Beta Was this translation helpful? Give feedback.
-
Another tip: we're using https://npmjs.com/package/debug, so you can do |
Beta Was this translation helpful? Give feedback.
-
We have been thinking extensively about this scenario, so trying to document our thinking in the lines below: We're on the same page as you that it should be easier to switch from single/multi column group render strategy to inline, without having to manually hide/show the column you group by. We should have an easier way of doing this. Then we tried to take another, more general approach - namely manage column visibility in a more powerful way.
columnVisibility=({ column, viewportSize, groupRowsBy, pivotBy, sortInfo, ... etc } => {
if (viewportSize.width < 500) {
return column.id in COLS_FOR_MOBILE
}
if (column.groupByField){
return true
}
if (groupRowsBy){
return !groupRowsBy.map(g=>g.field).includes(c.field)
}
})
const COLS_FOR_MOBILE = { name: true, id: true, age: true } The signature is not set in stone yet - still thinking about this. We're also considering how this would integrate with the column menu (also coming) that would allow end-users to select visible columns. The user selecting columns to show/hide would obviously call So we're not entirely sold on the idea of TLDRWe want to make this case easier to manage, so we want to implement the following:
Let us know what you think about the proposals. |
Beta Was this translation helpful? Give feedback.
-
Playing with the multiple
groupRenderStrategy
, the way the "inline
" strategy works (and the documentation) is a bit puzzling.Indeed I was expecting that the
"inline"
strategy works with the same inputs as the other strategies by default.Here is the scenario (based on https://infinite-table.com/docs/latest/learn/grouping-and-pivoting/grouping-rows ):
multiple-columns
" strategy + set thegroupRowsBy
with the column property + remove this column from the list of the columns map definition to not have it duplicated in the tablesingle
" strategy: works as expectedinline
" strategy: does not work as I thought, the group was not displayed.Indeed I figured out that for this particular mode we need to put back the definition of the group column inside the columns map definition. It's a bit inconsistent. What do you think ?
Here is a code sandbox that shows the "issue": https://codesandbox.io/s/sandpack-project-forked-5jg1y?file=/src/App.tsx
Beta Was this translation helpful? Give feedback.
All reactions