This section covers Server-Side Sorting using the Server-Side Row Model.
Sorting is enabled in the grid via the
sortable column definition attribute. Some example column
definitions with sorting enabled are shown below:
For more details on sorting configurations see the section on Row Sorting.
Sorting on the Server
The actual sorting of rows is performed on the server when using the Server-Side Row Model. When a sort is applied
in the grid a request is made for more rows via
getRows(params) on the
Server-Side Datasource. The
supplied params includes a request containing sort metadata contained in the
An example of the contents contained in the
sortModel is shown below:
Notice in the snippet above that the
sortModel contains an array of models for each column that has
active sorts in the grid. The column ID and sort type can then be used by the server to perform the actual sorting.
Example: Server-Side Sorting
The example below demonstrates server-side sorting. Notice the following:
- Try single / multi column (using
Shiftkey) sorting by clicking on column headers.
- All columns have sorting enabled using the
defaultColDefgrid options property with
- The server uses the metadata contained in the
sortModelto sort the rows.
- Open the browser's dev console to view the
sortModelsupplied in the request to the datasource.
Fake Server Implementation
However, note that the Server-Side Row Model does not impose any restrictions on the server-side technologies used.
Continue to the next section to learn about Server-Side Filtering.