Data Source components operate over collections of items, such as, Lists of Records, Shared Records, Set of Strings, etc. and include Table (forms::Table), Grid (forms::Grid), Tree Table (forms::TreeTable), and Repeater (forms::Repeater)
They allow you to visualize data items of such collections in a regular pattern. How the data is obtained is defined by the data source of the component.
With the exception of the Tree Table data source, which requires a data source of types specifically required by the component, the data sources can be defined as:
Note: If the query uses paging, the paging is ignored and the paging of the component is used instead.
setDataSource()
method on the component. Note: When applying filtering and sorting on large collections, sorting and filtering actions might cause performance issues: consider using other data sources such as shared Type data sources for large data sets.
getCount()
returns the number of displayed entries; note that you need to take the filters applied on the data into account. The filters are passed as input arguments.getData()
returns the data for the table; note that depending on your requirements, the method will need to filter, sort, and page data;supportFilter()
called when the user enters the filter value; The ID of the filters in individual columns is set in the FilterConfig: new FilterConfig(filterId -> "nameColumnFilter")
supportSort()
called when the user sorts the sort value;The data items are then used by the component items, for example, rows, as their sources of data. Data items are loaded lazily to allow reasonable performance when working with large data sets.