Framework:Javascript Data GridAngular Data GridReact Data GridVue Data Grid

Angular Data Grid: SSRM API Reference

The section lists the available Server-Side Row Model (SSRM) options.

SSRM Grid Options

serverSideDatasource
Provide the serverSideDatasource for server side row model. See Registering the Datasource.
serverSideDatasource: IServerSideDatasource;

interface IServerSideDatasource {
  // Grid calls `getRows` when it requires more rows as specified in the params.
  // Params object contains callbacks for responding to the request. 
  getRows(params: IServerSideGetRowsParams): void;
  // Optional method, if your datasource has state it needs to clean up. 
  destroy?(): void;
}

interface IServerSideGetRowsParams<TData = any> {
  // Details for the request. A simple object that can be converted to JSON. 
  request: IServerSideGetRowsRequest;
  // The parent row node. The RootNode (level -1) if request is top level.
  // This is NOT part fo the request as it cannot be serialised to JSON (a rowNode has methods). 
  parentNode: RowNode;
  // Success callback, pass the rows back to the grid that were requested. 
  success(params: LoadSuccessParams): void;
  // Fail callback, tell the grid the call failed so it can adjust it's state. 
  fail(): void;
  // The grid api. 
  api: GridApi<TData>;
  // The column api. 
  columnApi: ColumnApi;
  // Application context as set on `gridOptions.context`. 
  context: any;
}

interface IServerSideGetRowsRequest {
  // First row requested or undefined for all rows. 
  startRow: number | undefined;
  // Last row requested or undefined for all rows. 
  endRow: number | undefined;
  // Columns that are currently row grouped. 
  rowGroupCols: ColumnVO[];
  // Columns that have aggregations on them. 
  valueCols: ColumnVO[];
  // Columns that have pivot on them. 
  pivotCols: ColumnVO[];
  // Defines if pivot mode is on or off. 
  pivotMode: boolean;
  // What groups the user is viewing. 
  groupKeys: string[];
  // If filtering, what the filter model is. 
  filterModel: any;
  // If sorting, what the sort model is. 
  sortModel: SortModelItem[];
}

interface ColumnVO {
  id: string;
  displayName: string;
  field?: string;
  aggFunc?: string;
}

interface SortModelItem {
  // Column Id to apply the sort to. 
  colId: string;
  // Sort direction 
  sort: 'asc' | 'desc';
}

interface LoadSuccessParams {
  // Data retrieved from the server as requested by the grid. 
  rowData: any[];
  // The last row, if known, to help Infinite Scroll. 
  rowCount?: number;
  // Any extra information for the grid to associate with this load. 
  groupLevelInfo?: any;
}
serverSideInfiniteScroll
boolean
Set whether Server-side Row Model will use Infinite Scrolling
Default: false
cacheBlockSize
number
(Infinite Scroll only) How many rows for each block in the cache, i.e. how many rows returned from the server at a time.
Default: 100
maxBlocksInCache
number
(Infinite Scroll only) How many blocks to keep in the cache. 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 a low value.
maxConcurrentDatasourceRequests
number
How many requests to hit the server with concurrently. If the max is reached, requests are queued. Set to -1 for no maximum restriction on requests.
Default: 2
blockLoadDebounceMillis
number
How many milliseconds to wait before loading a block. Useful when infinite scrolling and scrolling over many infinite blocks, as it prevents blocks loading until scrolling has settled.
purgeClosedRowNodes
boolean
When enabled, closing group rows will remove children of that row. Next time the row is opened, child rows will be read from the datasource again. This property only applies when there is Row Grouping.
Default: false
serverSideSortAllLevels
boolean
When enabled, always refreshes top level groups regardless of which column was sorted. This property only applies when there is Row Grouping & sorting is handled on the server.
Default: false
serverSideFilterAllLevels
boolean
When enabled, always refreshes top level groups regardless of which column was filtered. This property only applies when there is Row Grouping & filtering is handled on the server.
Default: false
serverSideSortOnServer
boolean
When enabled, Sorting will be done on the server side. When serverSideInfiniteScroll=true, does nothing, as Sorting is always server side when Infinite Scroll is active.
Default: false
serverSideFilterOnServer
boolean
When enabled, Filtering will be done on the server side. When serverSideInfiniteScroll=true, does nothing, as Filtering is always server side when Infinite Scroll is active.
Default: false
serverSideInitialRowCount
number
Set how many loading rows to display to the user for the root level group. See Initial Scroll Position.
Default: 1
getChildCount
Function
Allows setting the child count for a group row.
getChildCount = (dataItem: any) => number;
getServerSideGroupLevelParams
Function
Allows providing different params for different levels of grouping.
getServerSideGroupLevelParams = (
    params: GetServerSideGroupLevelParamsParams
) => ServerSideGroupLevelParams;

interface GetServerSideGroupLevelParamsParams {
  // The level of the store. Top level is 0. 
  level: number;
  // The Row Node for the group that got expanded, or undefined if top level (ie no parent) 
  parentRowNode?: RowNode;
  // Active Row Group Columns, if any. 
  rowGroupColumns: Column[];
  // Active Pivot Columns, if any. 
  pivotColumns: Column[];
  // true if pivot mode is active. 
  pivotMode: boolean;
  // The grid api. 
  api: GridApi<any>;
  // The column api. 
  columnApi: ColumnApi;
  // Application context as set on `gridOptions.context`. 
  context: any;
}

interface ServerSideGroupLevelParams {
  // Whether to have infinite scroll active or not for the level. 
  infiniteScroll?: boolean;
  // For Infinite Scroll only.
  // How many blocks to keep in cache.
  // If missing, defaults to grid options `maxBlocksInCache`. 
  maxBlocksInCache?: number;
  // For Infinite Scroll only.
  // Cache block size.
  // If missing, defaults to grid options `cacheBlockSize`. 
  cacheBlockSize?: number;
}
isServerSideGroupOpenByDefault
Function
Allows groups to be open by default.
isServerSideGroupOpenByDefault = (
    params: IsServerSideGroupOpenByDefaultParams
) => boolean;

interface IsServerSideGroupOpenByDefaultParams {
  data: any;
  rowNode: RowNode;
  // The grid api. 
  api: GridApi<any>;
  // The column api. 
  columnApi: ColumnApi;
  // Application context as set on `gridOptions.context`. 
  context: any;
}
isApplyServerSideTransaction
Function
Allows cancelling transactions.
isApplyServerSideTransaction = (
    params: IsApplyServerSideTransactionParams
) => boolean;

interface IsApplyServerSideTransactionParams {
  // The transaction getting applied. 
  transaction: ServerSideTransaction;
  // The parent RowNode, if transaction is applied to a group. 
  parentNode: RowNode;
  // Store info, if any, as passed via the success() callback when loading data. 
  groupLevelInfo: any;
  // The grid api. 
  api: GridApi<any>;
  // The column api. 
  columnApi: ColumnApi;
  // Application context as set on `gridOptions.context`. 
  context: any;
}
isServerSideGroup
Function
SSRM Tree Data: Allows specifying which rows are expandable. See SSRM Tree Data.
isServerSideGroup = (dataItem: any) => boolean;
getServerSideGroupKey
Function
SSRM Tree Data: Allows specifying group keys. See SSRM Tree Data.
getServerSideGroupKey = (dataItem: any) => string;

Next Up

Continue to the next section to learn about the Server-Side Datasource.