class type t =Inheritsobject
..end
method isMixedCollection : bool Js.t Js.prop
true
in this class to identify an object as an instantiated MixedCollection, or subclass thereof.
Defaults to: true
method add : 'a 'b 'c. 'a Js.t -> 'b Js.t Js.optdef -> 'c Js.t Js.meth
Adds an item to the collection. Fires the add event when complete.
Parameters:
_ Js.t
The key to associate with the item, or the new item.
If a getKey implementation was specified for this MixedCollection,
or if the key of the stored items is in a property called id
,
the MixedCollection will be able to derive the key for the new item.
In this case just pass the new item in this parameter.
_ Js.t
(optional)
The item to add.
Returns:
_ Js.t
The item added.
method addAll : 'd. 'd Js.t -> unit Js.meth
Adds all elements of an Array or an Object to the collection.
Parameters:
_ Js.t
An Object containing properties which will be added
to the collection, or an Array of values, each of which are added to the collection.
Functions references will be added to the collection if allowFunctions
has been set to true
.
method clear : unit Js.meth
Removes all items from the collection. Fires the clear event when complete.
method clone : (< add : 'a 'b 'c. 'a Js.t -> 'b Js.t Js.optdef -> 'c Js.t Js.meth;
addAll : 'd. 'd Js.t -> unit Js.meth;
addEvents : 'g. 'g Js.t -> unit Js.meth;
addListener : 'h 'i 'j 'k 'l.
'h Js.t ->
'i Js.callback Js.optdef ->
'j Js.t Js.optdef -> 'k Js.t Js.optdef -> 'l Js.t Js.meth;
addManagedListener : 'm 'n 'o 'p 'q 'r.
'm Js.t ->
'n Js.t ->
'o Js.callback Js.optdef ->
'p Js.t Js.optdef ->
'q Js.t Js.optdef -> 'r Js.t Js.meth;
callParent : 's 't. 's Js.t -> 't Js.t Js.meth;
callSuper : 'u 'v. 'u Js.t -> 'v Js.t Js.meth; clear : unit Js.meth;
clearListeners : unit Js.meth; clearManagedListeners : unit Js.meth;
clone : 'e;
collect : 'w.
Js.js_string Js.t ->
Js.js_string Js.t Js.optdef ->
bool Js.t Js.optdef -> 'w Js.js_array Js.t Js.meth;
contains : 'x. 'x Js.t -> bool Js.t Js.meth;
containsKey : Js.js_string Js.t -> bool Js.t Js.meth;
each : 'y 'z. 'y Js.callback -> 'z Js.t Js.optdef -> unit Js.meth;
eachKey : 'a1 'b1. 'a1 Js.callback -> 'b1 Js.t Js.optdef -> unit Js.meth;
enableBubble : 'c1. 'c1 Js.t -> unit Js.meth;
filter : 'd1 'e1.
'd1 Js.t ->
'e1 Js.t ->
bool Js.t Js.optdef -> bool Js.t Js.optdef -> 'f Js.t Js.meth;
filterBy : 'f1 'g1.
'f1 Js.callback -> 'g1 Js.t Js.optdef -> 'f Js.t Js.meth;
findBy : 'h1 'i1 'j1.
'h1 Js.callback -> 'i1 Js.t Js.optdef -> 'j1 Js.t Js.meth;
findIndex : 'k1.
Js.js_string Js.t ->
'k1 Js.t ->
Js.number Js.t Js.optdef ->
bool Js.t Js.optdef ->
bool Js.t Js.optdef -> Js.number Js.t Js.meth;
findIndexBy : 'l1 'm1.
'l1 Js.callback ->
'm1 Js.t Js.optdef ->
Js.number Js.t Js.optdef -> Js.number Js.t Js.meth;
fireEvent : 'n1. Js.js_string Js.t -> 'n1 Js.t -> bool Js.t Js.meth;
fireEventArgs : 'o1.
Js.js_string Js.t ->
'o1 Js.t Js.js_array Js.t -> bool Js.t Js.meth;
first : 'p1. 'p1 Js.t Js.meth;
get : 'q1 'r1. 'q1 Js.t -> 'r1 Js.t Js.meth;
getAt : 's1. Js.number Js.t -> 's1 Js.t Js.meth;
getByKey : 't1 'u1. 't1 Js.t -> 'u1 Js.t Js.meth;
getCount : Js.number Js.t Js.meth;
getInitialConfig : 'v1. Js.js_string Js.t Js.optdef -> 'v1 Js.t Js.meth;
getKey : 'w1 'x1. 'w1 Js.t -> 'x1 Js.t Js.meth;
getRange : 'y1.
Js.number Js.t Js.optdef ->
Js.number Js.t Js.optdef -> 'y1 Js.js_array Js.t Js.meth;
hasListener : Js.js_string Js.t -> bool Js.t Js.meth;
hasListeners : 'z1. 'z1 Js.t Js.readonly_prop;
indexOf : 'a2. 'a2 Js.t -> Js.number Js.t Js.meth;
indexOfKey : Js.js_string Js.t -> Js.number Js.t Js.meth;
initConfig : 'b2. 'b2 Js.t -> 'f Js.t Js.meth;
insert : 'c2 'd2 'e2.
Js.number Js.t ->
'c2 Js.t -> 'd2 Js.t Js.optdef -> 'e2 Js.t Js.meth;
isMixedCollection : bool Js.t Js.prop; isObservable : bool Js.t Js.prop;
last : 'f2. 'f2 Js.t Js.meth;
mon : 'g2 'h2 'i2 'j2 'k2 'l2.
'g2 Js.t ->
'h2 Js.t ->
'i2 Js.callback Js.optdef ->
'j2 Js.t Js.optdef -> 'k2 Js.t Js.optdef -> 'l2 Js.t Js.meth;
mun : 'm2 'n2 'o2 'p2.
'm2 Js.t ->
'n2 Js.t ->
'o2 Js.callback Js.optdef -> 'p2 Js.t Js.optdef -> unit Js.meth;
on : 'q2 'r2 's2 't2 'u2.
'q2 Js.t ->
'r2 Js.callback Js.optdef ->
's2 Js.t Js.optdef -> 't2 Js.t Js.optdef -> 'u2 Js.t Js.meth;
relayEvents : 'v2 'w2.
'v2 Js.t ->
Js.js_string Js.t Js.js_array Js.t ->
Js.js_string Js.t Js.optdef -> 'w2 Js.t Js.meth;
remove : 'x2 'y2. 'x2 Js.t -> 'y2 Js.t Js.meth;
removeAll : 'z2. 'z2 Js.js_array Js.t Js.optdef -> 'f Js.t Js.meth;
removeAt : 'a3. Js.number Js.t -> 'a3 Js.t Js.meth;
removeAtKey : 'b3. Js.js_string Js.t -> 'b3 Js.t Js.meth;
removeListener : 'c3 'd3.
Js.js_string Js.t ->
'c3 Js.callback -> 'd3 Js.t Js.optdef -> unit Js.meth;
removeManagedListener : 'e3 'f3 'g3 'h3.
'e3 Js.t ->
'f3 Js.t ->
'g3 Js.callback Js.optdef ->
'h3 Js.t Js.optdef -> unit Js.meth;
removeRange : 'i3.
Js.number Js.t ->
Js.number Js.t Js.optdef -> 'i3 Js.t Js.meth;
replace : 'j3 'k3. Js.js_string Js.t -> 'j3 Js.t -> 'k3 Js.t Js.meth;
resumeEvent : Js.js_string Js.t -> unit Js.meth;
resumeEvents : unit Js.meth; self : Ext_Class.t Js.t Js.prop;
statics : Ext_Class.t Js.t Js.meth;
sum : Js.js_string Js.t ->
Js.js_string Js.t Js.optdef ->
Js.number Js.t Js.optdef ->
Js.number Js.t Js.optdef -> Js.number Js.t Js.meth;
suspendEvent : Js.js_string Js.t -> unit Js.meth;
suspendEvents : bool Js.t -> unit Js.meth;
un : 'l3 'm3.
Js.js_string Js.t ->
'l3 Js.callback -> 'm3 Js.t Js.optdef -> unit Js.meth;
updateKey : 'n3 'o3. 'n3 Js.t -> 'o3 Js.t -> unit Js.meth; .. >
as 'f)
Js.t Js.meth as 'e
Creates a shallow copy of this collection
method collect : 'w.
Js.js_string Js.t ->
Js.js_string Js.t Js.optdef ->
bool Js.t Js.optdef -> 'w Js.js_array Js.t Js.meth
Collects unique values of a particular property in this MixedCollection
Parameters:
Js.js_string Js.t
The property to collect on
Js.js_string Js.t
(optional)
'root' property to extract the first argument from. This is used mainly when summing fields in records, where the fields are all stored inside the 'data' object
bool Js.t
(optional)
Pass true to allow null, undefined or empty string values
Returns:
_ Js.js_array Js.t
The unique values
method contains : 'x. 'x Js.t -> bool Js.t Js.meth
Returns true if the collection contains the passed Object as an item.
Parameters:
_ Js.t
The Object to look for in the collection.
Returns:
bool Js.t
True if the collection contains the Object as an item.
method containsKey : Js.js_string Js.t -> bool Js.t Js.meth
Returns true if the collection contains the passed Object as a key.
Parameters:
Js.js_string Js.t
The key to look for in the collection.
Returns:
bool Js.t
True if the collection contains the Object as a key.
method each : 'y 'z. 'y Js.callback -> 'z Js.t Js.optdef -> unit Js.meth
Executes the specified function once for every item in the collection. The function should return a boolean value. Returning false from the function will stop the iteration.
Parameters:
_ Js.callback
The function to execute for each item.
_ Js.t
(optional)
The scope (this
reference)
in which the function is executed. Defaults to the current item in the iteration.
method eachKey : 'a1 'b1. 'a1 Js.callback -> 'b1 Js.t Js.optdef -> unit Js.meth
Executes the specified function once for every key in the collection, passing each key, and its associated item as the first two parameters.
Parameters:
_ Js.callback
The function to execute for each item.
_ Js.t
(optional)
The scope (this
reference) in which the
function is executed. Defaults to the browser window.
method filter : 'd1 'e1.
'd1 Js.t ->
'e1 Js.t -> bool Js.t Js.optdef -> bool Js.t Js.optdef -> 'f Js.t Js.meth
Filters the objects in this collection by a set of Filters, or by a single property/value pair with optional parameters for substring matching and case sensitivity. See Filter for an example of using Filter objects (preferred). Alternatively, MixedCollection can be easily filtered by property like this:
//create a simple store with a few people defined var people = new Ext.util.MixedCollection(); people.addAll([ {id: 1, age: 25, name: 'Ed'}, {id: 2, age: 24, name: 'Tommy'}, {id: 3, age: 24, name: 'Arne'}, {id: 4, age: 26, name: 'Aaron'} ]);
//a new MixedCollection containing only the items where age == 24 var middleAged = people.filter('age', 24);
Parameters:
_ Js.t
A property on your objects, or an array of Filter objects
_ Js.t
Either string that the property values should start with or a RegExp to test against the property
bool Js.t
(optional)
True to match any part of the string, not just the beginning
Defaults to: falsebool Js.t
(optional)
True for case sensitive comparison.
Defaults to: falseReturns:
Ext_util_MixedCollection.t Js.t
The new filtered collection
method filterBy : 'f1 'g1. 'f1 Js.callback -> 'g1 Js.t Js.optdef -> 'f Js.t Js.meth
Filter by a function. Returns a new collection that has been filtered. The passed function will be called with each object in the collection. If the function returns true, the value is included otherwise it is filtered.
Parameters:
_ Js.callback
The function to be called.
_ Js.t
(optional)
The scope (this
reference) in
which the function is executed. Defaults to this MixedCollection.
Returns:
Ext_util_MixedCollection.t Js.t
The new filtered collection
method findBy : 'h1 'i1 'j1. 'h1 Js.callback -> 'i1 Js.t Js.optdef -> 'j1 Js.t Js.meth
Returns the first item in the collection which elicits a true return value from the passed selection function.
Parameters:
_ Js.callback
The selection function to execute for each item.
_ Js.t
(optional)
The scope (this
reference) in which the
function is executed. Defaults to the browser window.
Returns:
_ Js.t
The first item in the collection which returned true from the selection function, or null if none was found.
method findIndex : 'k1.
Js.js_string Js.t ->
'k1 Js.t ->
Js.number Js.t Js.optdef ->
bool Js.t Js.optdef -> bool Js.t Js.optdef -> Js.number Js.t Js.meth
Finds the index of the first matching object in this collection by a specific property/value.
Parameters:
Js.js_string Js.t
The name of a property on your objects.
_ Js.t
A string that the property values should start with or a RegExp to test against the property.
Js.number Js.t
(optional)
The index to start searching at.
Defaults to: 0bool Js.t
(optional)
True to match any part of the string, not just the beginning.
Defaults to: falsebool Js.t
(optional)
True for case sensitive comparison.
Defaults to: falseReturns:
Js.number Js.t
The matched index or -1
method findIndexBy : 'l1 'm1.
'l1 Js.callback ->
'm1 Js.t Js.optdef -> Js.number Js.t Js.optdef -> Js.number Js.t Js.meth
Find the index of the first matching object in this collection by a function. If the function returns true it is considered a match.
Parameters:
_ Js.callback
The function to be called.
_ Js.t
(optional)
The scope (this
reference) in which the function is executed. Defaults to this MixedCollection.
Js.number Js.t
(optional)
The index to start searching at.
Defaults to: 0Returns:
Js.number Js.t
The matched index or -1
method first : 'p1. 'p1 Js.t Js.meth
Returns the first item in the collection.
Returns:
_ Js.t
the first item in the collection..
method get : 'q1 'r1. 'q1 Js.t -> 'r1 Js.t Js.meth
Returns the item associated with the passed key OR index. Key has priority over index. This is the equivalent of calling getByKey first, then if nothing matched calling getAt.
Parameters:
_ Js.t
The key or index of the item.
Returns:
_ Js.t
If the item is found, returns the item. If the item was not found, returns undefined
.
If an item was found, but is a Class, returns null
.
method getAt : 's1. Js.number Js.t -> 's1 Js.t Js.meth
Returns the item at the specified index.
Parameters:
Js.number Js.t
The index of the item.
Returns:
_ Js.t
The item at the specified index.
method getByKey : 't1 'u1. 't1 Js.t -> 'u1 Js.t Js.meth
Returns the item associated with the passed key.
Parameters:
_ Js.t
The key of the item.
Returns:
_ Js.t
The item associated with the passed key.
method getCount : Js.number Js.t Js.meth
Returns the number of items in the collection.
Returns:
Js.number Js.t
the number of items in the collection.
method getKey : 'w1 'x1. 'w1 Js.t -> 'x1 Js.t Js.meth
A function which will be called, passing a newly added object when the object is added without a separate id. The function should yield the key by which that object will be indexed.
If no key is yielded, then the object will be added, but it cannot be accessed or removed quickly. Finding it in this collection for interrogation or removal will require a linear scan of this collection's items.
The default implementation simply returns item.id
but you can
provide your own implementation to return a different value as
in the following examples:
// normal way
var mc = new Ext.util.MixedCollection();
mc.add(someEl.dom.id, someEl);
mc.add(otherEl.dom.id, otherEl);
//and so on
// using getKey
var mc = new Ext.util.MixedCollection({
getKey: function(el){
return el.dom.id;
}
});
mc.add(someEl);
mc.add(otherEl);
Parameters:
_ Js.t
The item for which to find the key.
Returns:
_ Js.t
The key for the passed item.
method getRange : 'y1.
Js.number Js.t Js.optdef ->
Js.number Js.t Js.optdef -> 'y1 Js.js_array Js.t Js.meth
Returns a range of items in this collection
Parameters:
Js.number Js.t
(optional)
The starting index. Defaults to 0.
Js.number Js.t
(optional)
The ending index. Defaults to the last item.
Returns:
_ Js.js_array Js.t
An array of items
method indexOf : 'a2. 'a2 Js.t -> Js.number Js.t Js.meth
Returns index within the collection of the passed Object.
Parameters:
_ Js.t
The item to find the index of.
Returns:
Js.number Js.t
index of the item. Returns -1 if not found.
method indexOfKey : Js.js_string Js.t -> Js.number Js.t Js.meth
Returns index within the collection of the passed key.
Parameters:
Js.js_string Js.t
The key to find the index of.
Returns:
Js.number Js.t
index of the key.
method insert : 'c2 'd2 'e2.
Js.number Js.t -> 'c2 Js.t -> 'd2 Js.t Js.optdef -> 'e2 Js.t Js.meth
Inserts an item at the specified index in the collection. Fires the add event when complete.
Parameters:
Js.number Js.t
The index to insert the item at.
_ Js.t
The key to associate with the new item, or the item itself. May also be an array of either to insert multiple items at once.
_ Js.t
(optional)
If the second parameter was a key, the new item. May also be an array to insert multiple items at once.
Returns:
_ Js.t
The item inserted or an array of items inserted.
method last : 'f2. 'f2 Js.t Js.meth
Returns the last item in the collection.
Returns:
_ Js.t
the last item in the collection..
method remove : 'x2 'y2. 'x2 Js.t -> 'y2 Js.t Js.meth
Remove an item from the collection.
Parameters:
_ Js.t
The item to remove.
Returns:
_ Js.t
The item removed or false if no item was removed.
method removeAll : 'z2. 'z2 Js.js_array Js.t Js.optdef -> 'f Js.t Js.meth
Remove all items in the collection. Can also be used to remove only the items in the passed array.
Parameters:
_ Js.js_array Js.t
(optional)
An array of items to be removed.
Returns:
Ext_util_MixedCollection.t Js.t
this object
method removeAt : 'a3. Js.number Js.t -> 'a3 Js.t Js.meth
Remove an item from a specified index in the collection. Fires the remove event when complete.
Parameters:
Js.number Js.t
The index within the collection of the item to remove.
Returns:
_ Js.t
The item removed or false if no item was removed.
method removeAtKey : 'b3. Js.js_string Js.t -> 'b3 Js.t Js.meth
Removes an item associated with the passed key fom the collection.
Parameters:
Js.js_string Js.t
The key of the item to remove. If null
is passed,
all objects which yielded no key from the configured getKey function are removed.
Returns:
_ Js.t
Only returned if removing at a specified key. The item removed or false if no item was removed.
method removeRange : 'i3. Js.number Js.t -> Js.number Js.t Js.optdef -> 'i3 Js.t Js.meth
Remove a range of items starting at a specified index in the collection. Does not fire the remove event.
Parameters:
Js.number Js.t
The index within the collection of the item to remove.
Js.number Js.t
(optional)
The nuber of items to remove beginning at the specified index.
Defaults to: 1Returns:
_ Js.t
The last item removed or false if no item was removed.
method replace : 'j3 'k3. Js.js_string Js.t -> 'j3 Js.t -> 'k3 Js.t Js.meth
Replaces an item in the collection. Fires the replace event when complete.
Parameters:
Js.js_string Js.t
The key associated with the item to replace, or the replacement item.
If you supplied a getKey implementation for this MixedCollection, or if the key
of your stored items is in a property called id
, then the MixedCollection
will be able to derive the key of the replacement item. If you want to replace an item
with one having the same key value, then just pass the replacement item in this parameter.
_ Js.t
{Object} o (optional) If the first parameter passed was a key, the item to associate with that key.
Returns:
_ Js.t
The new item.
method sum : Js.js_string Js.t ->
Js.js_string Js.t Js.optdef ->
Js.number Js.t Js.optdef ->
Js.number Js.t Js.optdef -> Js.number Js.t Js.meth
Collects all of the values of the given property and returns their sum
Parameters:
Js.js_string Js.t
The property to sum by
Js.js_string Js.t
(optional)
'root' property to extract the first argument from. This is used mainly when summing fields in records, where the fields are all stored inside the 'data' object
Js.number Js.t
(optional)
The record index to start at
Defaults to: 0Js.number Js.t
(optional)
The record index to end at
Defaults to: -1Returns:
Js.number Js.t
The total
method updateKey : 'n3 'o3. 'n3 Js.t -> 'o3 Js.t -> unit Js.meth
Change the key for an existing item in the collection. If the old key does not exist this is a no-op.
Parameters:
_ Js.t
The old key
_ Js.t
The new key