Search code examples
angular-ui-gridui-grid

ui-grid: how does virtualizationThreshold work?


Currently, the docs for virtualizationThreshold state:

Turn virtualization on when number of data elements goes over this number, defaults to 20

Does this actually mean that the virtualization engine is completely disabled if the grid has less rows than the threshold, or that it will virtualize any columns that exceed it?


Solution

  • No data elements will be virtualized if your data set is lower than the threshold but virtualization is still technically on. It's just that all items are already virtualized. If your data set grows larger and exceeds the threshold, items will start to be virtualized.

    example: You're using infinite scroll. Your threshold is set to 20 and your result pages have 5 items each. You won't start virtualizing any data until you hit 21 items after a few scrolls. Virtualization might not have been impacting anything on page load but it was still on just waiting to hit the threshold.