Additional data processing can be required when displaying collection type attributes.
Creatio lets you manage:
- pagination
- sorting
- filtering
Set up data processing in the viewModelConfig schema section.
Set up pagination
Use the internal pagingConfig property of the collection type attribute’s modelConfig property to set up pagination.
The pagingConfig property includes the following internal properties:
- rowCount. The number of records to upload to the page. The rowCount property value can be both a constant and the name of the attribute that contains this number.
- rowsOffset. An initial position (offset) to load the first portion of data. Can only be the name of the attribute that contains the offset number, not a constant. If you omit the property, Creatio sets the offset to 0.
Example of pagination
Set up sorting
Use the internal sortingConfig property of the collection type attribute’s modelConfig property to set up sorting.
The sortingConfig property includes the following internal properties:
- attributeName. Sorting attribute that manages sorting in Creatio UI, for example, in the section list. Required to load new data.
- default. Specifies the initial data sorting settings. An array of objects that have the following properties:
- columnName. Name of the column by which to sort data.
- direction. Sorting order. Available values: asc (ascending), desc (descending).
Example of sorting
Set up filtering
Use the internal filterAttributes property of the collection type attribute’s modelConfig property to set up filtering.
The filterAttributes property is an array of objects that have the following properties:
- name. Name of the attribute to filter data. For example, "FolderTree_items_DS_filter." Declare the attribute in the viewModelConfig schema section. Set the value property of this attribute to the object that configures the filter based on EntitySchemaQuery.
- loadOnChange. Specifies whether to reload the collection on filter change.
Example of filtering