Explanation
Since LIST and GRID style components have headers, it provides the ability to change the sort order by clicking on the header.
By default, virtual files have priority over local files.
// Setting whether to allow the sort order to be changed (true, false) by clicking the header column. dx.setEnableColumnSorting(false); // Setting whether to prioritize virtual files dx.setSortPriorityVirtualFile(true); // When an item is added, // 0: Do not sort, 1: Ascending, 2: Descending dx.setAutoSortingType(0); // Performing sorting on the given column (true if ascending, false otherwise). dx.sortColumnIndex(1, true); // Moving the item up dx.moveItemUp(1); // Moving the item down dx.moveItemDown(0);
Sorting is supported from 1.1.0.0 version.
Example
|
You can set the sort order to change by clicking on the header column.
|
|
When sorting items, you can set virtual file items to take precedence.
|
|
You can have it sort automatically whenever you add files.
|
|
You can sort by column (ascending or descending) immediately.
|
|
You can move the file up or down from its current location.
|