| Defined In: | StoreMgr.js |
| Class: | Ext.StoreMgr |
| Extends: | Ext.util.MixedCollection |
| 方法 | 定义者 | |
|---|---|---|
register
(
Ext.data.Store store1,
[Ext.data.Store store2]
)
登记更多的Store对象到StoreMgr。一般情况下你不需要手动...
登记更多的Store对象到StoreMgr。一般情况下你不需要手动加入。任何透过Ext.data.Store#storeId初始化的Store都会自动登记。
参数项:
|
StoreMgr | |
unregister
(
String/Object id1,
[String/Object id2]
)
注销一个或多个Stores
注销一个或多个Stores
参数项:
|
StoreMgr | |
lookup
(
String/Object id
)
: Ext.data.Store
由id返回一个已登记的Store
由id返回一个已登记的Store
参数项:
|
StoreMgr | |
MixedCollection
(
Boolean allowFunctions,
Function keyFn
)
: Ext.util.MixedCollection
构造器
构造器
参数项:
|
MixedCollection | |
add
(
String key,
Object o
)
: Object
加入一个item到集合中。
加入一个item到集合中。
参数项:
|
MixedCollection | |
|
getKey
(
)
: Object
如果你执行getKey的方法,MixedCollection有一个...
如果你执行getKey的方法,MixedCollection有一个通用的方法来取得keys。
默认的实现只是简单地返回item.id,
不过你可以按照下面的例子自定义一个实现,以返回另外一个值
参数项:
|
MixedCollection | |
replace
(
String key,
[Object o]
)
: Object
替换集合中的item。完成后触发#replace事件。
替换集合中的item。完成后触发#replace事件。
参数项:
|
MixedCollection | |
addAll
(
Object/Array objs
)
将数组中或是对象中的所有元素加入到集合中。
将数组中或是对象中的所有元素加入到集合中。
参数项:
|
MixedCollection | |
each
(
Function fn,
Object scope
)
在集合中执行每个Item的指定函数。函数执行时,会有下列的参数:
...
在集合中执行每个Item的指定函数。函数执行时,会有下列的参数:
参数项:
|
MixedCollection | |
eachKey
(
Function fn,
[Object scope]
)
传入一个函数类型的参数,然后在集合中的每个Item执行。key和其...
传入一个函数类型的参数,然后在集合中的每个Item执行。key和其相关的item都作为头两个参数传入。
参数项:
|
MixedCollection | |
find
(
Function fn,
[Object scope]
)
: Object
根据传入的函数,执行该函数若返回true便说明这是要找到的那个it...
根据传入的函数,执行该函数若返回true便说明这是要找到的那个item。
参数项:
|
MixedCollection | |
insert
(
Number index,
String key,
[Object o]
)
:
指定集合中的某个索引然后插入一个Item
指定集合中的某个索引然后插入一个Item
参数项:
|
MixedCollection | |
remove
(
Object o
)
: Object
从集合中移除Item
从集合中移除Item
参数项:
|
MixedCollection | |
removeAt
(
Number index
)
: Object
从集合中移除由index指定的Item。完成后触发#remove事件。
从集合中移除由index指定的Item。完成后触发#remove事件。
参数项:
|
MixedCollection | |
removeKey
(
String key
)
: Object
根据传入参数key,从集合中移除相关的item
根据传入参数key,从集合中移除相关的item
参数项:
|
MixedCollection | |
|
getCount
(
)
: Number
返回集合中的item总数。
返回集合中的item总数。
参数项:
|
MixedCollection | |
indexOf
(
Object o
)
: Number
传入一个对象,返回它的索引。
传入一个对象,返回它的索引。
参数项:
|
MixedCollection | |
indexOfKey
(
String key
)
: Number
传入一个Key,返回它的索引。
传入一个Key,返回它的索引。
参数项:
|
MixedCollection | |
| item ( ) : Object | MixedCollection | |
itemAt
(
Number index
)
: Object
根据索引找到item
根据索引找到item
参数项:
|
MixedCollection | |
key
(
String/Number key
)
: Object
根据key找到item
根据key找到item
参数项:
|
MixedCollection | |
contains
(
Object o
)
: Boolean
若在集合中找到传入的item,则返回true。
若在集合中找到传入的item,则返回true。
参数项:
|
MixedCollection | |
containsKey
(
Object o
)
: Boolean
若在集合中找到传入的key,则返回true。
若在集合中找到传入的key,则返回true。
参数项:
|
MixedCollection | |
|
clear
(
)
清除集合中所有item
清除集合中所有item
参数项:
|
MixedCollection | |
|
first
(
)
: Object
返回集合中第一个item
返回集合中第一个item
参数项:
|
MixedCollection | |
|
last
(
)
: Object
返回集合中最后一个item
返回集合中最后一个item
参数项:
|
MixedCollection | |
|
sort
(
)
按传入的函数排列集合
按传入的函数排列集合
参数项:
|
MixedCollection | |
|
keySort
(
)
按key顺序排列集合
按key顺序排列集合
参数项:
|
MixedCollection | |
getRange
(
[Number startIndex],
[Number endIndex]
)
: Array
返回这个集合中的某个范围内的items
返回这个集合中的某个范围内的items
参数项:
|
MixedCollection | |
filter
(
String property,
String/RegExp value,
Boolean anyMatch,
Boolean caseSensitive
)
: MixedCollection
由指定的属性过滤集合中的对象。
返回以过滤后的新集合
由指定的属性过滤集合中的对象。
返回以过滤后的新集合
参数项:
|
MixedCollection | |
filterBy
(
Function fn,
[Object scope]
)
: MixedCollection
由函数过滤集合中的对象。
返回以过滤后的新集合
传入的函数会被...
由函数过滤集合中的对象。
返回以过滤后的新集合
传入的函数会被集合中每个对象执行。如果函数返回true,则value会被包含否则会被过滤、
参数项:
|
MixedCollection | |
findIndex
(
String property,
String/RegExp value,
[Number start],
[Boolean anyMatch],
[Boolean caseSensitive]
)
: Number
由指定的属性/值查找集合中的第一个匹配对象。
这个对象是过滤后的...
由指定的属性/值查找集合中的第一个匹配对象。
这个对象是过滤后的新集合
参数项:
|
MixedCollection | |
findIndexBy
(
Function fn,
[Object scope],
[Number start]
)
: MixedCollection
由函数过滤集合中的对象。
返回以过滤后的新集合
传入的函数会被...
由函数过滤集合中的对象。
返回以过滤后的新集合
传入的函数会被集合中每个对象执行。如果函数返回true,则value会被包含否则会被过滤、
参数项:
|
MixedCollection | |
|
clone
(
)
: MixedCollection
创建集合副本
创建集合副本
参数项:
|
MixedCollection | |
get
(
String/Number key
)
: Object
根据key或索引返回item。key的优先权高于索引。
@met...
根据key或索引返回item。key的优先权高于索引。
@method
参数项:
|
MixedCollection | |
| 事件 | 定义者 | |
|---|---|---|
|
clear
(
)
当集合被清除后触发。
当集合被清除后触发。
参数项:
|
MixedCollection | |
add
(
Number index,
Object o,
String key
)
当item被加入到集合之后触发。
当item被加入到集合之后触发。
参数项:
|
MixedCollection | |
replace
(
String key,
Object old,
Object new
)
集合中的item被替换后触发。
集合中的item被替换后触发。
参数项:
|
MixedCollection | |
remove
(
Object o,
[String key]
)
当item被移除集合时触发。
当item被移除集合时触发。
参数项:
|
MixedCollection | |