DataTableSorting
A data category by which to sort the table in descending or ascending order.
Declaration
object DataTableSortingProperties
| Name | Type | Description |
|---|---|---|
descriptor Required | string | The |
direction Required | string | The data sorting direction. |
Discussion
In a DataTable object, use the sortBy property to sort data already in a table. You can specify which data is to be sorted and the order (ascending or descending). If this property is not defined, data is displayed in the order it is provided in the RecordStore.
This object can be used in DataTable.
Example
{
"components": [
{
"role": "datatable",
"showDescriptorLabels": true,
"sortBy": [
{
"descriptor": "id-name",
"direction": "descending"
}
],
"data": {
"descriptors": [
{
"identifier": "id-name",
"key": "name",
"label": {
"type": "formatted_text",
"text": "Name",
"textStyle": {
"textColor": "black"
}
},
"dataType": "string"
},
{
"identifier": "id-occupation",
"key": "occupation",
"label": "Occupation",
"dataType": "string"
}
],
"records": [
{
"name": "Amelia Earhart",
"occupation": "Pilot"
},
{
"name": "Grace Hopper",
"occupation": "Computer Scientist"
}
]
}
}
]
}