DevExpress / devextreme-reactive

Business React components for Bootstrap and Material-UI

Home Page:https://devexpress.github.io/devextreme-reactive/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Banding+fixed column error

jahglow opened this issue · comments

  • I have searched this repository's issues and believe that this is not a duplicate.

I'm using ...

  • React Grid - latest
  • React Chart
  • React Scheduler

Current Behaviour

When a grid is used with TableColumnVisibility, TableFixedColumns and TableBandHeader with at least one column hidden, dx-react-grid throws an error in TableFixedColumnsBase.render

problems:
dx-react-grid.tableHeaderColumnChains -> dx.grid.core.tableHeaderColumnChainsWithFixed :

  • tableHeaderColumnChains can be undefined and the function doesn't account for that
  • tableHeaderColumnChainsWithFixed doesn't account for column being undefined at shouldSplitChain and extendChainProps when the column is hidden - it doesn't come in the columns array from splitHeaderColumnChains

calculateFixedColumnProps expects tableHeaderColumnChains to be an array and it might be undefined and the following line fails as well as anything that goes after it where the columnChain is referenced:

      var columnChain = findChainByColumnIndex(tableHeaderColumnChains[0], index);

Expected Behaviour

column bands should work well in conjunction with hidden and fixed columns

Steps to Reproduce

  • Create grid with TableColumnVisibility, TableFixedColumns and TableBandHeader plugins
  • make the first column fixed, pass column bands (the first column should not be banded)
  • pass some hiddenColumnNames to <TableColumnVisibility> from those used in bands

Environment

"@devexpress/dx-core": "^2.7.6",
"@devexpress/dx-grid-core": "^2.7.6",
"@devexpress/dx-react-core": "^2.7.6",
"@devexpress/dx-react-grid": "^2.7.6",
"@devexpress/dx-react-grid-material-ui": "^2.7.6",
  • react: 17.0.1
  • browser: Chrome latest
  • bootstrap: none
  • react-bootstrap: none
  • material-ui: none