Sorting multisite viewsRequired version: 1.1.11i3
August 23. 2011
Sorting multisite view dataIn the past it was only possible to sort the multisite views using fixed configured sorters. As of version 1.1.11i3 it is now possible to let the user sort the data shown in multisite views by individual columns. The basicsEach view has it's own default and optional sorters. The optional sorters depend on the type of data and columns shown. For example the list of Service problems is first grouped by the current service state and secondly sorted by the state age. As you see not only a list of default and custom sorters is relevant here, we do also have to take the grouping of data rows into account. So we use the following order of sorting criteria:
The single columns have different sort rules, for example numeric or string sorting in simple cases. There are more complex sort mechanism, for example sorting by nagios states. So each sortable column needs to have it's assigned sorter mechanism. But there are some columns which will never be sortable, for example the icon columns. It simply makes no sense to sort by them. Enabling customized sortings in viewsThe customized sorting feature can be enabled and disabled for each view. To enable this feature the following layout options have to be set in the view editor:
Customizing sortingIn views where the customized sorting feature is enabled the user can click on column titles to change the sorting criteria or the sort order. The first click on a title enables sorting by this column. The second click on the title changes the order of this sorting criteria and the third click on the title disables this sorting criteria. When the user clicks on different column titles after each other, the sorters are added to the user sorters list and applied. The last applied sorter has the higher priority. When leaving the current view to another page the custom sorters are gone. Sorting in URLsWhen a user clicks on a clickable column title, the current page reloads with the new (or changed) parameter sort. The value of the sort parameter is a comma separated list of view sorter names. Each sorter name can have a leading - sign for negating the sort order of this sorter. This is used to realise ascending and descendings sortings. When showing the view data each single sorter is applied to the data in the order of the sorter names in the sort value. |
| ||||||||||||