PresentationTableDataProvider Class

Presentation Rules-driven table data provider.

Extends

Implements

Methods

Name Description
constructor(props: PresentationTableDataProviderProps): PresentationTableDataProvider Constructor.  
configureContentDescriptor(descriptor: Readonly<Descriptor>): Descriptor Protected Handles filtering and sorting.  
getLoadedRow(rowIndex: number): Readonly<RowItem> | undefined Try to get a loaded row.  
getRow(rowIndex: number): Promise<RowItem> Get a single row.  
getRowKey(row: RowItem): InstanceKey Get key of ECInstance that's represented by the supplied row  
getRowsCount(): Promise<number> Get the total number of rows.  
invalidateCache(props: CacheInvalidationProps): void Protected    
sort(columnIndex: number, sortDirection: UiSortDirection): Promise<void> Sorts the data in this data provider.  

Inherited methods

Name Inherited from Description
dispose(): void ContentDataProvider Destructor.
getContent(pageOptions?: PageOptions): Promise<Content | undefined> ContentDataProvider Get the content.
getContentSetSize(): Promise<number> ContentDataProvider Get the number of content records.
getDescriptorOverrides(): DescriptorOverrides Protected ContentDataProvider Get the content descriptor overrides.
getFieldByPropertyRecord(propertyRecord: PropertyRecord): Promise<Field | undefined> ContentDataProvider Get field using PropertyRecord.
isFieldHidden(_field: Field): boolean Protected ContentDataProvider Called to check whether the field should be hidden.
shouldConfigureContentDescriptor(): boolean Protected ContentDataProvider Called to check whether the content descriptor needs advanced configuration.
shouldExcludeFromDescriptor(field: Field): boolean Protected ContentDataProvider Called to check whether the field should be excluded from the descriptor.
shouldRequestContentForEmptyKeyset(): boolean Protected ContentDataProvider Called to check if content should be requested even when keys is empty.

Properties

Name Type Description
filterExpression Accessor string | undefined ECExpression for filtering data in the table.  
getColumns (Anonymous function) & MemoizedFunction Returns column definitions.  
onColumnsChanged TableDataChangeEvent    
onRowsChanged TableDataChangeEvent    
sortColumn Accessor ReadOnly Promise<ColumnDescription | undefined> Get the column which is used for sorting data in the table.  
sortColumnKey Accessor ReadOnly string Get key of the column which is used for sorting data in the table.  
sortDirection Accessor ReadOnly SortDirection Get sort direction.  

Inherited properties

Name Type Inherited from Description
displayType Accessor ReadOnly string ContentDataProvider Display type used to format content
getContentDescriptor (Anonymous function) & MemoizedFunction ContentDataProvider Get the content descriptor.
imodel Accessor IModelConnection ContentDataProvider IModel to pull data from
keys Accessor KeySet ContentDataProvider Keys defining what to request content for
pagingSize Accessor number | undefined ContentDataProvider Paging options for obtaining content.

Presentation data providers, when used with paging, have ability to save one backend request for size / count. That
can only be achieved when pagingSize property is set on the data provider and it's value matches size which is used when
requesting content. To help developers notice this problem, data provider emits a warning similar to this:
<br>ContentDataProvider.pagingSize doesn't match pageOptions in ContentDataProvider.getContent call. Make sure you set provider's pagingSize to avoid excessive backend requests.<br>
To fix the issue, developers should make sure the page size used for requesting data is also set for the data provider:
TS<br>const pageSize = 10;<br>const provider = new ContentDataProvider(imodel, rulesetId, displayType);<br>provider.pagingSize = pageSize;<br>// only one backend request is made for the two following requests:<br>provider.getContentSetSize();<br>provider.getContent({ start: 0, size: pageSize });<br>
rulesetId Accessor string ContentDataProvider Id of the ruleset to use when requesting content
selectionInfo Accessor SelectionInfo ContentDataProvider Information about selection event that results in content change

Defined in

Last Updated: 13 June, 2024