Framework:Javascript GridAngular GridReact GridVue Grid

JavaScript Grid: SSRM Configuration

This section covers the Server-Side Row Model (SSRM) configuration options.

SSRM Grid Properties

Applications can fine-tune the Server-Side Row Model based on specific application requirements using the following configurations:

serverSideStoreTypeWhether to use Full Store or Partial Store for storing rows. See Row Stores
Default: 'full'
Options: 'full', 'partial'
cacheBlockSizePartial Store Only - How many rows for each block in the store, i.e. how many rows returned from the server at a time.
Default: 100
maxBlocksInCachePartial Store Only - how many blocks to keep in the store. Default is no limit, so every requested block is kept. Use this if you have memory concerns, and blocks that were least recently viewed will be purged when the limit is hit. The grid will additionally make sure it has all the blocks needed to display what is currently visible - in case this property is set to low.
maxConcurrentDatasourceRequestsHow many requests to hit the server with concurrently. If the max is reached, requests are queued.
Default: 1
blockLoadDebounceMillisHow many milliseconds to wait before loading a block. Useful when scrolling over many rows, spanning many Partial Store blocks, as it prevents blocks loading until scrolling has settled.
purgeClosedRowNodesWhen enabled, closing group rows will remove children of that row. Next time the row is opened, child rows will be read form the datasoruce again. This property only applies when there is Row Grouping.
serverSideSortingAlwaysResetsWhen enabled, always refreshes top level groups regardless of which column was sorted. This property only applies when there is Row Grouping.
serverSideFilteringAlwaysResetsWhen enabled, always refreshes stores after filter has changed. Use by Full Store only, to allow Server-Side Filtering.

Debug Info

When experimenting with different configurations it is useful to enable debug mode as follows:

gridOptions.debug = true;

The screenshot below is taken from the browser's dev console when debug is enabled:

Console Output

Notice that the current cache status is logged showing block details such as the startRow and endRow.

This can be very useful when debugging issues on the server.

Custom Partial Store

The example below shows a customised SSRM using the Partial Store. Note the following:

  • The grid property serverSideStoreType = partial, which gets the Partial Store to be used. The grid loads rows one block at a time as the user scrolls down.
  • The grid property cacheBlockSize = 50. This sets the block size to 50, thus rows are read back 50 at a time.
  • The grid property maxBlocksInCache = 2. This means the grid will keep two blocks in memory only. To see this in action, scroll past row 100 (which will require a third block to be loaded), then quickly scroll back to the start and you will observe the first block needs to be reloaded.
  • The grid property rowBuffer = 0. This means the grid will not render any rows outside the vertical scroll. This is good for demonstrating this example, as otherwise the loading could appear outside of the visible area and make the example more difficult to understand. See DOM Virtualisation for more information on setting the rowBuffer property.

Custom Loading Debounce

The example below demonstrates debouncing the block loading. Note the following:

  • The response from the server sets the rowCount property so that the vertical scrollbars bounds are set such that the entire dataset can be scrolled through. In other words, infinite scrolling is turned off, however rows are still loaded in blocks.
  • blockLoadDebounceMillis = 1000 - loading of blocks is delayed by 1000ms. This allows for skipping over blocks when scrolling to advanced positions.
  • The grid property debug = true. This means the browser's dev console will show loading block details.

Next Up

Continue to the next section to learn about Sorting.