class type t =Inheritsobject
..end
method isSortable : bool Js.t Js.prop
true
in this class to identify an object as an instantiated Sortable, or subclass thereof.
Defaults to: true
method sorters : 'a. 'a Js.t Js.prop
The collection of Sorters currently applied to this Store
method generateComparator : unit Js.meth
Returns a comparator function which compares two items and returns -1, 0, or 1 depending on the currently defined set of sorters.
If there are no sorters defined, it returns a function which returns 0
meaning
that no sorting will occur.
method getFirstSorter : Ext_util_Sorter.t Js.t Js.meth
Gets the first sorter from the sorters collection, excluding any groupers that may be in place
Returns:
Ext_util_Sorter.t Js.t
The sorter, null if none exist
method initSortable : unit Js.meth
Performs initialization of this mixin. Component classes using this mixin should call this method during their own initialization.
method sort : 'b.
'b Js.t Js.optdef ->
Js.js_string Js.t Js.optdef -> Ext_util_Sorter.t Js.js_array Js.t Js.meth
Sorts the data in the Store by one or more of its properties. Example usage:
//sort by a single field
myStore.sort('myField', 'DESC');
//sorting by multiple fields
myStore.sort([
{
property : 'age',
direction: 'ASC'
},
{
property : 'name',
direction: 'DESC'
}
]);
Internally, Store converts the passed arguments into an array of Ext.util.Sorter instances, and delegates the actual sorting to its internal Ext.util.MixedCollection.
When passing a single string argument to sort, Store maintains a ASC/DESC toggler per field, so this code:
store.sort('myField');
store.sort('myField');
Is equivalent to this code, because Store handles the toggling automatically:
store.sort('myField', 'ASC');
store.sort('myField', 'DESC');
Parameters:
_ Js.t
(optional)
Either a string name of one of the fields in this Store's configured Model, or an array of sorter configurations.
Js.js_string Js.t
(optional)
The overall direction to sort the data by.
Defaults to: "ASC"