@serenity-is/corelib / IGridBoundView
Interface: IGridBoundView<TItem>
Defined in: src/slick/iremoteview.ts:354
A view that loads its rows as the grid it is bound to is scrolled, so it needs to know the grid, e.g. to load the next rows when its viewport gets near the last one.
Extends
IRemoteView<TItem>
Type Parameters
TItem
TItem = any
Properties
onAjaxCall
onAjaxCall:
RemoteViewAjaxCallback<TItem>
Defined in: src/slick/iremoteview.ts:164
Callback invoked before making AJAX calls
Inherited from
onDataChanged
readonlyonDataChanged:EventEmitter<ArgsRemoteView>
Defined in: src/slick/iremoteview.ts:166
Event fired when the underlying data changes
Inherited from
onDataLoaded
readonlyonDataLoaded:EventEmitter<ArgsRemoteView>
Defined in: src/slick/iremoteview.ts:168
Event fired when data loading completes
Inherited from
onDataLoading
readonlyonDataLoading:EventEmitter<ArgsRemoteView>
Defined in: src/slick/iremoteview.ts:170
Event fired when data loading begins
Inherited from
onGroupCollapsed?
readonlyoptionalonGroupCollapsed:EventEmitter<ArgsGroupToggle>
Defined in: src/slick/iremoteview.ts:172
Event fired when a group is collapsed
Inherited from
onGroupExpanded?
readonlyoptionalonGroupExpanded:EventEmitter<ArgsGroupToggle>
Defined in: src/slick/iremoteview.ts:174
Event fired when a group is expanded
Inherited from
onPagingInfoChanged
readonlyonPagingInfoChanged:EventEmitter<ArgsPagingInfo>
Defined in: src/slick/iremoteview.ts:176
Event fired when paging information changes
Inherited from
IRemoteView.onPagingInfoChanged
onProcessData
onProcessData:
RemoteViewProcessCallback<TItem>
Defined in: src/slick/iremoteview.ts:178
Callback invoked to process data received from the server
Inherited from
onRecalcRows
readonlyonRecalcRows:EventEmitter<ArgsRecalcRows>
Defined in: src/slick/iremoteview.ts:180
Event fired when rows need to be recalculated
Inherited from
onRowCountChanged
readonlyonRowCountChanged:EventEmitter<ArgsRowCountChanged>
Defined in: src/slick/iremoteview.ts:182
Event fired when the row count changes
Inherited from
onRowsChanged?
readonlyoptionalonRowsChanged:EventEmitter<{rows:number[]; }>
Defined in: ../sleekgrid/dist/index.d.ts:2604
Event fired when specific view rows change (values or metadata).
Payload is { rows } with the list of affected view indices.
Inherited from
onRowsOrCountChanged?
readonlyoptionalonRowsOrCountChanged:EventEmitter<ArgsRowsOrCountChanged>
Defined in: src/slick/iremoteview.ts:184
Event fired when rows or count change
Inherited from
IRemoteView.onRowsOrCountChanged
onSubmit
onSubmit:
CancellableViewCallback<TItem>
Defined in: src/slick/iremoteview.ts:186
Callback invoked before submitting a request, can cancel the operation
Inherited from
params
params:
Record<string,any>
Defined in: src/slick/iremoteview.ts:188
Additional parameters to send with service requests
Inherited from
seekToPage
seekToPage:
number
Defined in: src/slick/iremoteview.ts:214
The page number to seek to when loading data
Inherited from
sortBy
sortBy:
string[]
Defined in: src/slick/iremoteview.ts:274
Sort expressions for the data
Inherited from
url
url:
string
Defined in: src/slick/iremoteview.ts:295
The URL to fetch data from
Inherited from
Methods
addData()?
optionaladdData(data):boolean
Defined in: src/slick/iremoteview.ts:14
Adds data received from the server to the view.
Parameters
data
any
The response data from the server
Returns
boolean
Inherited from
addItem()?
optionaladdItem(item):void
Defined in: src/slick/iremoteview.ts:19
Adds an item to the end of the items array.
Parameters
item
any
The item to add
Returns
void
Inherited from
beginUpdate()
beginUpdate():
void
Defined in: src/slick/iremoteview.ts:24
Begins a batch update operation. Multiple changes can be made without triggering refreshes. Call endUpdate() to complete the batch and refresh the view.
Returns
void
Inherited from
bindToGrid()
bindToGrid(
grid):void
Defined in: src/slick/iremoteview.ts:359
Binds the view to a grid, so it loads its rows as the grid is scrolled.
Parameters
grid
ISleekGrid
The grid that shows the rows of the view.
Returns
void
collapseAllGroups()?
optionalcollapseAllGroups(level?):void
Defined in: src/slick/iremoteview.ts:29
Collapses all groups at the specified level, or all levels if not specified.
Parameters
level?
number
Optional level to collapse. If not specified, applies to all levels.
Returns
void
Inherited from
collapseGroup()?
optionalcollapseGroup(varArgs):void
Defined in: src/slick/iremoteview.ts:36
Collapses a specific group.
Parameters
varArgs
any[]
Either a Slick.Group's "groupingKey" property, or a variable argument list of grouping values denoting a unique path to the row. For example, calling collapseGroup('high', '10%') will collapse the '10%' subgroup of the 'high' group.
Returns
void
Inherited from
deleteItem()?
optionaldeleteItem(id):void
Defined in: src/slick/iremoteview.ts:41
Deletes an item by its ID.
Parameters
id
any
The ID of the item to delete
Returns
void
Inherited from
destroy()?
optionaldestroy():void
Defined in: src/slick/iremoteview.ts:116
Stops the view when it is no longer used, e.g. with the grid of it, so the rows it asked for before are ignored.
Returns
void
Inherited from
endUpdate()
endUpdate():
void
Defined in: src/slick/iremoteview.ts:46
Ends a batch update operation. If this is the outermost endUpdate call, refreshes the view to reflect all changes made during the batch.
Returns
void
Inherited from
expandAllGroups()?
optionalexpandAllGroups(level?):void
Defined in: src/slick/iremoteview.ts:51
Expands all groups at the specified level, or all levels if not specified.
Parameters
level?
number
Optional level to expand. If not specified, applies to all levels.
Returns
void
Inherited from
expandGroup()?
optionalexpandGroup(varArgs):void
Defined in: src/slick/iremoteview.ts:58
Expands a specific group.
Parameters
varArgs
any[]
Either a Slick.Group's "groupingKey" property, or a variable argument list of grouping values denoting a unique path to the row. For example, calling expandGroup('high', '10%') will expand the '10%' subgroup of the 'high' group.
Returns
void
Inherited from
getFilter()?
optionalgetFilter():RemoteViewFilter<TItem>
Defined in: src/slick/iremoteview.ts:63
Gets the current filter function.
Returns
RemoteViewFilter<TItem>
The current filter function
Inherited from
getFilteredItems()
getFilteredItems():
any[]
Defined in: src/slick/iremoteview.ts:69
Gets the filtered items (after applying the current filter).
Returns
any[]
Array of filtered items
Inherited from
getGrandTotals()
getGrandTotals():
IGroupTotals
Defined in: ../sleekgrid/dist/index.d.ts:2552
Gets grand totals aggregated over the entire data set.
Returns
IGroupTotals
Grand totals object containing sum/avg/min/max, if any.
Inherited from
getGrouping()?
optionalgetGrouping():GroupInfo<TItem>[]
Defined in: src/slick/iremoteview.ts:75
Gets the current grouping configuration.
Returns
GroupInfo<TItem>[]
Array of grouping information
Inherited from
getGroupItemMetadataProvider()?
optionalgetGroupItemMetadataProvider():GroupItemMetadataProvider
Defined in: src/slick/iremoteview.ts:80
Gets the group item metadata provider.
Returns
GroupItemMetadataProvider
The metadata provider
Inherited from
IRemoteView.getGroupItemMetadataProvider
getGroups()?
optionalgetGroups():Group<TItem>[]
Defined in: src/slick/iremoteview.ts:85
Gets the current groups.
Returns
Group<TItem>[]
Array of groups
Inherited from
getIdPropertyName()
getIdPropertyName():
string
Defined in: src/slick/iremoteview.ts:90
Gets the name of the property used as the unique identifier for items.
Returns
string
The ID property name
Inherited from
getIdxById()
getIdxById(
id):number
Defined in: src/slick/iremoteview.ts:96
Gets the index of an item by its ID.
Parameters
id
any
The ID of the item
Returns
number
The index of the item, or undefined if not found
Inherited from
getItem()
getItem(
row):IGroupTotals<any> |TItem|Group<TItem>
Defined in: ../sleekgrid/dist/index.d.ts:2563
Gets the item at the specified view row.
Parameters
row
number
Zero-based view index.
Returns
IGroupTotals<any> | TItem | Group<TItem>
Data item, Group header, or IGroupTotals row.
Inherited from
getItemById()
getItemById(
id):TItem
Defined in: src/slick/iremoteview.ts:102
Gets an item by its ID.
Parameters
id
any
The ID of the item
Returns
TItem
The item with the specified ID
Inherited from
getItemByIdx()
getItemByIdx(
i):any
Defined in: src/slick/iremoteview.ts:108
Gets an item by its index in the items array.
Parameters
i
number
The index of the item
Returns
any
The item at the specified index
Inherited from
getItemMetadata()?
optionalgetItemMetadata(row):ItemMetadata<TItem>
Defined in: ../sleekgrid/dist/index.d.ts:2569
Gets row metadata (CSS classes, per-column overrides) for the specified view row.
Parameters
row
number
Zero-based view index.
Returns
ItemMetadata<TItem>
Metadata object or undefined when none applies.
Inherited from
getItemMetadataCallback()
getItemMetadataCallback(): (
item,row) =>ItemMetadata<TItem>
Defined in: src/slick/iremoteview.ts:112
Gets a callback function to retrieve item metadata. This can be used to dynamically assign CSS classes or other properties to items.
Returns
(
item,row):ItemMetadata<TItem>
Parameters
item
TItem
row
number
Returns
ItemMetadata<TItem>
Inherited from
IRemoteView.getItemMetadataCallback
getItems()
getItems():
TItem[]
Defined in: src/slick/iremoteview.ts:121
Gets all items in the view.
Returns
TItem[]
Array of all items
Inherited from
getLength()
getLength():
number
Defined in: ../sleekgrid/dist/index.d.ts:2557
Gets the total number of rows currently in the view (including group headers/totals).
Returns
number
Row count.
Inherited from
getLocalSort()?
optionalgetLocalSort():boolean
Defined in: src/slick/iremoteview.ts:126
Gets whether local sorting is enabled.
Returns
boolean
true if local sorting is enabled
Inherited from
getPagingInfo()
getPagingInfo():
PagingInfo
Defined in: src/slick/iremoteview.ts:131
Gets the current paging information.
Returns
Object containing paging state information
Inherited from
getPagingInfoText()?
optionalgetPagingInfoText():RenderableContent
Defined in: src/slick/iremoteview.ts:139
Gets the content a pager can show before its controls, e.g. the totals of the page and of all the rows. The pager calls it on every update, and shows nothing when it returns nothing, so a view without aggregates does not have to implement it. A string is shown as text, so anything with markup is returned as an element or a fragment instead.
Returns
The content to show, or nothing.
Inherited from
getRowById()?
optionalgetRowById(id):number
Defined in: src/slick/iremoteview.ts:145
Gets the row index for an item by its ID.
Parameters
id
any
The ID of the item
Returns
number
The row index of the item
Inherited from
getRowByItem()?
optionalgetRowByItem(item):number
Defined in: src/slick/iremoteview.ts:151
Gets the row index for an item.
Parameters
item
any
The item to find
Returns
number
The row index of the item
Inherited from
getRows()
getRows(): (
Group<any> |GroupTotals<any> |TItem)[]
Defined in: src/slick/iremoteview.ts:156
Gets all rows in the view (including group rows and totals rows).
Returns
(Group<any> | GroupTotals<any> | TItem)[]
Array of all rows
Inherited from
getRowStripe()?
optionalgetRowStripe(row):"odd"|"even"
Defined in: ../sleekgrid/dist/index.d.ts:2577
Gets the stripe (odd / even row style) of the specified view row. When not implemented, rows are striped by their index. Grouping views use it to start each group with an odd row like the first row of the grid, and to leave group header and totals rows unstriped.
Parameters
row
number
Zero-based view index.
Returns
"odd" | "even"
"odd", "even", or null for a row that has neither class.
Inherited from
insertItem()?
optionalinsertItem(insertBefore,item):void
Defined in: src/slick/iremoteview.ts:162
Inserts an item at the specified position.
Parameters
insertBefore
number
The index to insert before
item
any
The item to insert
Returns
void
Inherited from
populate()
populate():
boolean
Defined in: src/slick/iremoteview.ts:193
Loads data from the server using the configured URL and parameters.
Returns
boolean
false if the operation was cancelled or no URL is configured
Inherited from
populateLock()
populateLock():
void
Defined in: src/slick/iremoteview.ts:198
Locks population to prevent automatic data loading. Use this when you want to make multiple changes without triggering loads.
Returns
void
Inherited from
populateUnlock()
populateUnlock():
void
Defined in: src/slick/iremoteview.ts:202
Unlocks population. If there were pending populate calls while locked, executes them.
Returns
void
Inherited from
refresh()
refresh():
void
Defined in: src/slick/iremoteview.ts:208
Refresh the view by recalculating the rows and notifying changes. Note that this does not re-fetch the data from the server, use populate method for that purpose.
Returns
void
Inherited from
reSort()
reSort():
void
Defined in: src/slick/iremoteview.ts:212
Re-sorts the items using the current sort settings.
Returns
void
Inherited from
setFilter()
setFilter(
filterFn):void
Defined in: src/slick/iremoteview.ts:219
Sets the filter function to apply to items.
Parameters
filterFn
RemoteViewFilter<TItem>
The filter function to apply
Returns
void
Inherited from
setGrouping()?
optionalsetGrouping(groupingInfo):void
Defined in: src/slick/iremoteview.ts:224
Sets the grouping configuration for the view.
Parameters
groupingInfo
Grouping information or array of grouping information
GroupInfo<TItem> | GroupInfo<TItem>[]
Returns
void
Inherited from
setGroupItemMetadataProvider()?
optionalsetGroupItemMetadataProvider(value):void
Defined in: src/slick/iremoteview.ts:229
Sets the group item metadata provider.
Parameters
value
GroupItemMetadataProvider
The metadata provider to set
Returns
void
Inherited from
IRemoteView.setGroupItemMetadataProvider
setItemMetadataCallback()
setItemMetadataCallback(
value):void
Defined in: src/slick/iremoteview.ts:240
Sets a callback function to retrieve item metadata. This can be used to dynamically assign CSS classes or other properties to items.
Parameters
value
(item, row) => ItemMetadata<TItem>
The item metadata callback.
Returns
void
Inherited from
IRemoteView.setItemMetadataCallback
setItems()
setItems(
data,newIdProperty?):void
Defined in: src/slick/iremoteview.ts:235
Sets the items in the view and optionally changes the ID property.
Parameters
data
any[]
Array of items to set
newIdProperty?
Optional new ID property name, or boolean to reset
string | boolean
Returns
void
Inherited from
setLocalSort()?
optionalsetLocalSort(value):void
Defined in: src/slick/iremoteview.ts:245
Sets whether to use local sorting. When enabled, sorting is done client-side.
Parameters
value
boolean
Whether to enable local sorting
Returns
void
Inherited from
setPagingOptions()
setPagingOptions(
args):void
Defined in: src/slick/iremoteview.ts:250
Sets paging options and triggers a data reload if options changed.
Parameters
args
The paging options to set
Returns
void
Inherited from
setSummaryOptions()?
optionalsetSummaryOptions(summary):void
Defined in: src/slick/iremoteview.ts:255
Sets summary/aggregation options for the view.
Parameters
summary
Object containing aggregators and other summary options
Returns
void
Inherited from
sort()?
optionalsort(comparer?,ascending?):void
Defined in: src/slick/iremoteview.ts:261
Sorts the items using the specified comparer function.
Parameters
comparer?
(a, b) => number
Optional custom comparer function
ascending?
boolean
Whether to sort in ascending order (default true)
Returns
void
Inherited from
sortedAddItem()?
optionalsortedAddItem(item):void
Defined in: src/slick/iremoteview.ts:266
Adds an item in sorted order.
Parameters
item
any
The item to add
Returns
void
Inherited from
sortedUpdateItem()?
optionalsortedUpdateItem(id,item):void
Defined in: src/slick/iremoteview.ts:272
Updates an item while maintaining sorted order.
Parameters
id
any
The ID of the item to update
item
any
The new item data
Returns
void
Inherited from
syncGridCellCssStyles()?
optionalsyncGridCellCssStyles(grid,key):void
Defined in: src/slick/iremoteview.ts:280
Syncs cell CSS styles between the grid and the data view.
Parameters
grid
ISleekGrid
The grid to sync with.
key
string
The CSS style key.
Returns
void
Inherited from
IRemoteView.syncGridCellCssStyles
syncGridSelection()?
optionalsyncGridSelection(grid,preserveHidden?,preserveHiddenOnSelectionChange?):EventEmitter<any, { }>
Defined in: src/slick/iremoteview.ts:287
Wires the grid and the DataView together to keep row selection tied to item ids.
Parameters
grid
ISleekGrid
The grid to sync selection with.
preserveHidden?
boolean
Whether to keep selected items that go out of view due to filtering.
preserveHiddenOnSelectionChange?
boolean
Whether to keep hidden items selected when selection changes.
Returns
EventEmitter<any, { }>
Inherited from
updateItem()
updateItem(
id,item):void
Defined in: src/slick/iremoteview.ts:293
Updates an existing item in the view.
Parameters
id
any
The ID of the item to update
item
any
The new item data
Returns
void