sortFieldsList(compareFunction: Function)
[starting from version 2.9.17]
Sets custom sorting for Field List items.
sortFieldsList()
can be defined in two ways:
flexmonster.sortFieldsList(compareFunction)
.new Flexmonster({sortFieldsList: compareFunction, ...})
.Parameter/Type | Description |
---|---|
compareFunction Function |
Defines the sort order and works similarly to the compareFunction of the Array.sort() method.Data passed to the compareFunction :
compareFunction should return the positive, negative, or zero value. |
Sort Field List items in reverse alphabetical order:
flexmonster.sortFieldsList(function(firstItem, secondItem, viewType) { return secondItem.caption.localeCompare(firstItem.caption); });
See the full code on JSFiddle.