[Performance Increase] Improve Horizontal Scroll by not rendering rows
#6.972 aberto em 8 de mai. de 2019
Métricas do repositório
- Stars
- (5.395 stars)
- Métricas de merge de PR
- (Nenhuma PRs mesclada em 30d)
Description
Summary: add grid options to not render rows whenever the horizontal scroll speed reaches a threshold in order to improve horizontal scroll performance
When the rows are not rendered (before data is in the grid). Horizontal scrolling performs much better than when there is data in the grid. The performance is impacted whenever there a lot of columns, like in excess of 100 columns.
We should have a grid option of something like gridOption.renderRowsOnHorizontalScroll = false;
and maybe have another threshold that will tell the grid when to stop rendering the rows. So if the user is scrolling fast (ie. the number of columns that will have to be re-rendered is equal to the number of columns in view +excess columns rendered) then the rows will not be rendered. This already happens when horizontal scrolling is done very quickly, but both the columns and rows disappear and ui-grid attempts to re-render both at the same time while scrolling horizontally.
gridOption.horizontalScrollRenderRowsThreshold = 10; //when the number of columns needed to be re-rendered is greater than or equal too 10 this above default to the number of columns in the view plus the number of excess columns rendered
Scrolling horizontally does not need to re-render columns which is why it outperforms rows. After a certain horizontal scrolling speed the user cannot see the row data anyway. So we should have a way to disable the rendering when scrolling to increase performance.