SortConfigurationCollection / PartialSortConfigurationCollection
Description
A SortConfigurationCollection represents a collection of key/value pairs, where key is a string used to identify the corresponding SortConfiguration. It extends ResourceCollection<SortConfiguration>.
Properties
|
Property |
Element |
Type |
Description |
|---|---|---|---|
|
key |
|
string |
The field of the column. |
|
|
value |
The sort configuration of the column. |
Example
In this example, a comparer function is created in order to sort the column “id” with all the values “2” being on top for an ascending sort (and at the end for a descending sort). The comparer is set as a value in the SortConfiguration for the “id” column. This SortConfiguration is part of the sortConfigurationsSortConfigurationCollection. This collection is then set as the DataGridOptions.sortConfigurations.
function myComparer(x, y)
{
if (x === 2)
return -1;
return 1;
}
const sortConfigurations = { "id": { comparer: myComparer } }
const options = {
sortConfigurations: sortConfigurations
};
const datagrid = new Xceed.DataGrid("containerId", options);
Remarks
A partial type/interface is an object in which properties are optional.