@serenity-is/corelib / IRemoteView
Interface: IRemoteView<TItem>
Defined in: src/slick/iremoteview.ts:9
Interface for an extension of IDataView that support remote data loading
Extends
IDataView<TItem>
Type Parameters
TItem
TItem = any
Properties
onAjaxCall
onAjaxCall:
RemoteViewAjaxCallback<TItem>
Defined in: src/slick/iremoteview.ts:148
Callback invoked before making AJAX calls
onDataChanged
readonlyonDataChanged:EventEmitter<ArgsRemoteView>
Defined in: src/slick/iremoteview.ts:150
Event fired when the underlying data changes
Overrides
IDataView.onDataChanged
onDataLoaded
readonlyonDataLoaded:EventEmitter<ArgsRemoteView>
Defined in: src/slick/iremoteview.ts:152
Event fired when data loading completes
onDataLoading
readonlyonDataLoading:EventEmitter<ArgsRemoteView>
Defined in: src/slick/iremoteview.ts:154
Event fired when data loading begins
onGroupCollapsed?
readonlyoptionalonGroupCollapsed:EventEmitter<ArgsGroupToggle>
Defined in: src/slick/iremoteview.ts:156
Event fired when a group is collapsed
onGroupExpanded?
readonlyoptionalonGroupExpanded:EventEmitter<ArgsGroupToggle>
Defined in: src/slick/iremoteview.ts:158
Event fired when a group is expanded
onPagingInfoChanged
readonlyonPagingInfoChanged:EventEmitter<ArgsPagingInfo>
Defined in: src/slick/iremoteview.ts:160
Event fired when paging information changes
onProcessData
onProcessData:
RemoteViewProcessCallback<TItem>
Defined in: src/slick/iremoteview.ts:162
Callback invoked to process data received from the server
onRowCountChanged
readonlyonRowCountChanged:EventEmitter<ArgsRowCountChanged>
Defined in: src/slick/iremoteview.ts:164
Event fired when the row count changes
Overrides
IDataView.onRowCountChanged
onRowsChanged?
readonlyoptionalonRowsChanged:EventEmitter<{rows:number[]; }>
Defined in: ../sleekgrid/dist/index.d.ts:1282
Event fired when specific rows change
Inherited from
IDataView.onRowsChanged
onRowsOrCountChanged?
readonlyoptionalonRowsOrCountChanged:EventEmitter<ArgsRowsOrCountChanged>
Defined in: src/slick/iremoteview.ts:166
Event fired when rows or count change
onSubmit
onSubmit:
CancellableViewCallback<TItem>
Defined in: src/slick/iremoteview.ts:168
Callback invoked before submitting a request, can cancel the operation
params
params:
Record<string,any>
Defined in: src/slick/iremoteview.ts:170
Additional parameters to send with service requests
seekToPage
seekToPage:
number
Defined in: src/slick/iremoteview.ts:196
The page number to seek to when loading data
sortBy
sortBy:
string[]
Defined in: src/slick/iremoteview.ts:251
Sort expressions for the data
url
url:
string
Defined in: src/slick/iremoteview.ts:267
The URL to fetch data 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
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
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
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
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
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
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
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
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
getFilter()?
optionalgetFilter():RemoteViewFilter<TItem>
Defined in: src/slick/iremoteview.ts:63
Gets the current filter function.
Returns
RemoteViewFilter<TItem>
The current filter function
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
getGrandTotals()
getGrandTotals():
IGroupTotals
Defined in: ../sleekgrid/dist/index.d.ts:1267
Gets the grand totals for all aggregated data.
Returns
IGroupTotals
Inherited from
IDataView.getGrandTotals
getGrouping()?
optionalgetGrouping():GroupInfo<TItem>[]
Defined in: src/slick/iremoteview.ts:75
Gets the current grouping configuration.
Returns
GroupInfo<TItem>[]
Array of grouping information
getGroupItemMetadataProvider()?
optionalgetGroupItemMetadataProvider():GroupItemMetadataProvider
Defined in: src/slick/iremoteview.ts:80
Gets the group item metadata provider.
Returns
GroupItemMetadataProvider
The metadata provider
getGroups()?
optionalgetGroups():Group<TItem>[]
Defined in: src/slick/iremoteview.ts:85
Gets the current groups.
Returns
Group<TItem>[]
Array of groups
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
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
getItem()
getItem(
row):IGroupTotals<any> |TItem|Group<TItem>
Defined in: ../sleekgrid/dist/index.d.ts:1271
Gets the item at the specified row index.
Parameters
row
number
Returns
IGroupTotals<any> | TItem | Group<TItem>
Inherited from
IDataView.getItem
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
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
getItemMetadata()?
optionalgetItemMetadata(row):ItemMetadata<TItem>
Defined in: ../sleekgrid/dist/index.d.ts:1273
Gets metadata for the item at the specified row index.
Parameters
row
number
Returns
ItemMetadata<TItem>
Inherited from
IDataView.getItemMetadata
getItems()
getItems():
TItem[]
Defined in: src/slick/iremoteview.ts:113
Gets all items in the view.
Returns
TItem[]
Array of all items
getLength()
getLength():
number
Defined in: ../sleekgrid/dist/index.d.ts:1269
Gets the total number of rows in the view.
Returns
number
Inherited from
IDataView.getLength
getLocalSort()?
optionalgetLocalSort():boolean
Defined in: src/slick/iremoteview.ts:118
Gets whether local sorting is enabled.
Returns
boolean
true if local sorting is enabled
getPagingInfo()
getPagingInfo():
PagingInfo
Defined in: src/slick/iremoteview.ts:123
Gets the current paging information.
Returns
Object containing paging state information
getRowById()?
optionalgetRowById(id):number
Defined in: src/slick/iremoteview.ts:129
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
getRowByItem()?
optionalgetRowByItem(item):number
Defined in: src/slick/iremoteview.ts:135
Gets the row index for an item.
Parameters
item
any
The item to find
Returns
number
The row index of the item
getRows()
getRows(): (
TItem|Group<any> |GroupTotals<any>)[]
Defined in: src/slick/iremoteview.ts:140
Gets all rows in the view (including group rows and totals rows).
Returns
(TItem | Group<any> | GroupTotals<any>)[]
Array of all rows
insertItem()?
optionalinsertItem(insertBefore,item):void
Defined in: src/slick/iremoteview.ts:146
Inserts an item at the specified position.
Parameters
insertBefore
number
The index to insert before
item
any
The item to insert
Returns
void
populate()
populate():
boolean
Defined in: src/slick/iremoteview.ts:175
Loads data from the server using the configured URL and parameters.
Returns
boolean
false if the operation was cancelled or no URL is configured
populateLock()
populateLock():
void
Defined in: src/slick/iremoteview.ts:180
Locks population to prevent automatic data loading. Use this when you want to make multiple changes without triggering loads.
Returns
void
populateUnlock()
populateUnlock():
void
Defined in: src/slick/iremoteview.ts:184
Unlocks population. If there were pending populate calls while locked, executes them.
Returns
void
refresh()
refresh():
void
Defined in: src/slick/iremoteview.ts:190
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
reSort()
reSort():
void
Defined in: src/slick/iremoteview.ts:194
Re-sorts the items using the current sort settings.
Returns
void
setFilter()
setFilter(
filterFn):void
Defined in: src/slick/iremoteview.ts:201
Sets the filter function to apply to items.
Parameters
filterFn
RemoteViewFilter<TItem>
The filter function to apply
Returns
void
setGrouping()?
optionalsetGrouping(groupingInfo):void
Defined in: src/slick/iremoteview.ts:206
Sets the grouping configuration for the view.
Parameters
groupingInfo
Grouping information or array of grouping information
GroupInfo<TItem> | GroupInfo<TItem>[]
Returns
void
setGroupItemMetadataProvider()?
optionalsetGroupItemMetadataProvider(value):void
Defined in: src/slick/iremoteview.ts:211
Sets the group item metadata provider.
Parameters
value
GroupItemMetadataProvider
The metadata provider to set
Returns
void
setItems()
setItems(
data,newIdProperty?):void
Defined in: src/slick/iremoteview.ts:217
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
setLocalSort()?
optionalsetLocalSort(value):void
Defined in: src/slick/iremoteview.ts:222
Sets whether to use local sorting. When enabled, sorting is done client-side.
Parameters
value
boolean
Whether to enable local sorting
Returns
void
setPagingOptions()
setPagingOptions(
args):void
Defined in: src/slick/iremoteview.ts:227
Sets paging options and triggers a data reload if options changed.
Parameters
args
The paging options to set
Returns
void
setSummaryOptions()?
optionalsetSummaryOptions(summary):void
Defined in: src/slick/iremoteview.ts:232
Sets summary/aggregation options for the view.
Parameters
summary
Object containing aggregators and other summary options
Returns
void
sort()?
optionalsort(comparer?,ascending?):void
Defined in: src/slick/iremoteview.ts:238
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
sortedAddItem()?
optionalsortedAddItem(item):void
Defined in: src/slick/iremoteview.ts:243
Adds an item in sorted order.
Parameters
item
any
The item to add
Returns
void
sortedUpdateItem()?
optionalsortedUpdateItem(id,item):void
Defined in: src/slick/iremoteview.ts:249
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
syncGridCellCssStyles()?
optionalsyncGridCellCssStyles(grid,key):void
Defined in: src/slick/iremoteview.ts:255
Syncs cell CSS styles between the grid and the data view.
Parameters
grid
ISleekGrid
key
string
Returns
void
syncGridSelection()?
optionalsyncGridSelection(grid,preserveHidden?,preserveHiddenOnSelectionChange?):EventEmitter<any, { }>
Defined in: src/slick/iremoteview.ts:259
Wires the grid and the DataView together to keep row selection tied to item ids.
Parameters
grid
ISleekGrid
preserveHidden?
boolean
preserveHiddenOnSelectionChange?
boolean
Returns
EventEmitter<any, { }>
updateItem()
updateItem(
id,item):void
Defined in: src/slick/iremoteview.ts:265
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