Skip to main content

@topgrid/grid-pro-serverside-vue

Pro: server-side row model (SSRM) + viewport (push) row model for Vue 3 — reuses the framework-neutral @topgrid/grid-pro-serverside-core controllers. · Commercial (EULA)

Auto-generated

This page is auto-generated from the TSDoc comments in the source code (internal markers stripped). For a curated getting-started summary, see the API Reference.

20 public exports — 4 functions · 3 hooks · 0 components · 13 types · 0 constants.

Hooks

useVueServerSideData

useVueServerSideData(datasource: ServerSideDatasource<TData>, options: UseVueServerSideDataOptions): UseVueServerSideDataResult<TData>

useVueServerSideTree

useVueServerSideTree(datasource: ServerSideDatasource<TData>, options: UseVueServerSideTreeOptions): UseVueServerSideTreeResult<TData>

useVueViewportRowModel

useVueViewportRowModel(datasource: ViewportDatasource<TData>, options: UseVueViewportRowModelOptions): UseVueViewportRowModelResult<TData>

Functions

buildServerPivotColumns

Build a nested pivot-result column tree from the server's flat field keys.

buildServerPivotColumns(fields: string[], separator: string): ServerPivotColumn[]
ParameterTypeDescription
fieldsstring[]server-generated pivot-result field keys (order = desired column order).
separatorstringsegment delimiter within a field key (default '|').

checkLicense

Synchronously checks the current license state and returns a LicenseCheckResult.

  • If valid=false, then watermarkRequired=true.
  • If valid and less than 60 days remain until expiresAt, then expiryWarning='soon-expiring' + console.warn (once).
  • If valid with sufficient time before expiry, then { valid: true, watermarkRequired: false }.
checkLicense(): LicenseCheckResult

isRowPlaceholder

Type guard for placeholder rows from materialize.

isRowPlaceholder(row: unknown): row

setLicenseKey

Global license registration API for Pro packages. Call once from the app entry (main.tsx / App.tsx).

setLicenseKey(key: string): LicenseStatus
ParameterTypeDescription
keystringLicense key in the format Base64url(pubKey).Base64url(sig).Base64url(payload)

Returns — LicenseStatus — returned immediately (synchronous wrapper; state is updated after the internal asynchronous verification completes). Note: the return value is designed as a synchronous API so it can be used immediately without a Promise. Internally it stores the result of verifySignature (async). If getLicenseState is called before the asynchronous completion, it returns the default {valid:false, reason:'invalid'} value.

Types & Interfaces

GetRowsRequest

A block request: half-open row range [startRow, endRow) + current sort/filter.

For lazy grouping the request also carries the group path being expanded. groupKeys/ rowGroupCols are optional — absent/empty = flat mode (/ behavior unchanged), so existing flat datasources keep working. The level is groupKeys.length; the returned block holds group rows when level < rowGroupCols.length, otherwise leaf rows (AG convention).

PropertyTypeDescription
endRownumberOne past the last row index (exclusive).
filterModelFilterModelActive filter model (server applies).
groupKeys?string[]Path of group key values to the node whose children are requested ([]/absent = top level).
pivotCols?string[]Pivot dimension columns (outermost first) — the values become column groups.
pivotMode?booleanServer-side pivot — optional, absent = no pivot (flat/group behavior unchanged). When pivotMode is true the server pivots valueCols across pivotCols and returns rows keyed by the generated pivot-result fields, plus the field list in GetRowsResult.pivotResultFields.
rowGroupCols?string[]Columns being grouped, outermost first (absent/empty = no grouping).
sortModelSortModelItem[]Active sort directives (server applies).
startRownumberFirst row index (inclusive) — within the addressed group's children.
valueCols?string[]Value/measure columns aggregated within each pivot column combination.

GetRowsResult

A block response. lastRow carries the total/last-row signal the virtualizer needs to size the scroll area: set it to the absolute total row count once the server knows the end has been reached (e.g. a partial final block), otherwise leave undefined (more rows exist).

PropertyTypeDescription
lastRow?numberAbsolute total row count when known (end reached), else undefined.
pivotResultFields?string[]Server-side pivot — the generated pivot-result field keys (e.g. "East|sales"), in column order. The grid feeds these to buildServerPivotColumns to derive the dynamic column tree. Absent for non-pivot responses. (Typically identical across blocks of one query.)
rowsTData[]The rows for the requested range (length ≤ endRow − startRow).

RowPlaceholder

Placeholder row emitted by materialize for not-yet-loaded indices.

PropertyTypeDescription
__ssrmPlaceholdertrueDiscriminant — consumers test this to render a loading skeleton cell.
rowIndexnumberAbsolute row index this placeholder stands in for.

ServerPivotColumn

A derived pivot-result column: a leaf (accessorKey) or a group (columns).

PropertyTypeDescription
accessorKey?stringLeaf only: the row field this column reads (the full server field key).
columns?ServerPivotColumn[]Group only: nested child columns.
headerstringHeader label (the dimension value, or the measure name for a leaf).
idstringStable id (group: the path prefix; leaf: the full field key).

ServerSideDatasource

Consumer-supplied datasource. The single seam between the grid and the server.

PropertyTypeDescription
getRowsunknown

UseVueServerSideDataOptions

PropertyTypeDescription
blockSizenumberRows per block (request unit).
pivot?{ … }Server-side pivot (optional). When set, requests carry pivotMode/pivotCols/valueCols.
rowCountnumberInitial total row count (refined by the response's lastRow).

UseVueServerSideDataResult

PropertyTypeDescription
dataRef<TData | RowPlaceholder[]>Reactive row data — not-yet-loaded indices are RowPlaceholder (detect with isRowPlaceholder).
ensureRange(…) => …Ensure the visible range (wire the virtualization visible range here).
pivotColumnsRef<ServerPivotColumn[]>Columns derived from the server pivot result (empty array before a pivot response arrives / when not pivoting).
refresh(…) => …Invalidate the cache (epoch++) + re-request the visible range (discard in-flight responses).
setColumnFilters(…) => …Change filters (derives server parameters).
setSorting(…) => …Change sorting (derives server parameters).
totalCountRef<number>Reactive total row count (grows as lastRow is learned).

UseVueServerSideTreeOptions

PropertyTypeDescription
blockSizenumberRows per block (per-node request unit).
rowGroupColsstring[]Grouping columns, outermost first (e.g. ['country', 'city']).

UseVueServerSideTreeResult

PropertyTypeDescription
dataRef<TreeDisplayRow<TData>[]>Reactive display rows (group/leaf, including __ssrm meta).
ensureRange(…) => …Ensure the visible range (wire the virtualization visible range here).
refresh(…) => …Invalidate the whole tree + re-request the visible range.
setColumnFilters(…) => …Change filters.
setSorting(…) => …Change sorting.
toggleGroup(…) => …Expand/collapse a group — call from the group cell renderer with row.__ssrm.groupKeys.

UseVueViewportRowModelOptions

PropertyTypeDescription
rowCountnumberInitial total row count (refined by the datasource's setRowCount).

UseVueViewportRowModelResult

PropertyTypeDescription
dataRef<RowPlaceholder | TData[]>Reactive row data — may include RowPlaceholder (detect with isRowPlaceholder).
setRange(…) => …Notify of a visible range change (wire the virtualization library's visible range here).
totalCountRef<number>Reactive total row count (grows as the datasource pushes).

ViewportDatasource

Consumer-supplied viewport datasource (AG IViewportDatasource shape).

PropertyTypeDescription
destroy?unknown
initunknown
setViewportRangeunknown

ViewportDatasourceParams

Callbacks the controller hands the datasource so it can push counts/rows.

PropertyTypeDescription
setRowCount(…) => …Set the total row count (sizes the virtualizer).
setRowData(…) => …Push rows by absolute index (in-place — re-pushing an index updates that row live).