Angular Grid Manual Sorting
The manual sorting gives the developer full control over the arranging of the data in the desired order. Compared to the sorting with the built-in directive, the manual approach provides greater transparency of the process because it requires you to handle the Grid events manually. The manual sorting is especially useful when you require additional customizations of the sorting logic.
To enable sorting:
- Set the
- Bind the
sortoption to a collection of
- Handle either of the following events:
When other data operations like paging, filtering, or grouping, are also enabled, handle the
dataStateChangeevent instead of
sortChange. For more details, check the section on how to handle multiple data operations.
The following example demonstrates how to sort the data by handling the
sortChange event and using the
dataStateChange event to send a request containing information about the current Grid state to the server. For more details, check the section on how to handle multiple data operations using remote data.