react-virtualized table x-scrolling

有些话、适合烂在心里 提交于 2020-03-03 08:52:32

问题


Is it possible to set a x-scrolling in react-virtualized? I have a table with a fixed width, and more columns to display than I got space in my table, so I need a x-scrollinig. In my tests if i did it, the table just shrinked up and did just display '...''s for content if the table runs out of space.


回答1:


Intro paragraph for react-virtualized Table docs (emphasis added):

Table component with fixed headers and windowed rows for improved performance with large data sets. This component expects explicit width and height parameters. Table content can scroll vertically but it is not meant to scroll horizontally.

You might be able to hack it, but it isn't meant to support horizontal scrolling so it probably won't work. Consider using Grid or MultiGrid instead if this is a requirement for your app.




回答2:


Building on bvaughn's accepted answer, the hack for a horizontally scrollable table could look something like this, however, beware of the following caveats that come with this hack:

  • Your overflowing Table columns will not be virtualized
  • The scrolling focus gets captured by the wrapper's x-axis scrolling and you will need to click within the internal Table component to refocus and regain y-axis scrolling. This is incredibly frustrating to use especially on mobile devices.


来源:https://stackoverflow.com/questions/46177344/react-virtualized-table-x-scrolling

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!