| Package: | Ext.grid |
| Defined In: | .js |
| Class: | |
| Extends: | Ext.util.MixedCollection |
| 方法 | 定义者 | |
|---|---|---|
lookup
(
String/Object id
)
:
由id返回一个已登记的Store
由id返回一个已登记的Store
参数项:
|
StoreMgr | |
add
(
String key,
Object o
)
: Object
加入一个item到集合中。
加入一个item到集合中。
参数项:
|
MixedCollection | |
getKey
(
*/
)
: Object
如果你执行getKey的方法,MixedCollection有一个通用...
如果你执行getKey的方法,MixedCollection有一个通用的方法来取得keys。
默认的实现只是简单地返回item.id,
不过你可以按照下面的例子自定义一个实现,以返回另外一个值
参数项:
|
MixedCollection | |
replace
(
String key,
)
: Object
替换集合中的item。完成后触发{@link #replace}事件。
替换集合中的item。完成后触发{@link #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便说明这是要找到的那个item。
根据传入的函数,执行该函数若返回true便说明这是要找到的那个item。
参数项:
|
MixedCollection | |
insert
(
Number index,
String key,
[Object o]
)
: Object
指定集合中的某个索引然后插入一个Item
指定集合中的某个索引然后插入一个Item
参数项:
|
MixedCollection | |
remove
(
Object o
)
: Object
从集合中移除Item
从集合中移除Item
参数项:
|
MixedCollection | |
removeAt
(
Number index
)
: Object
从集合中移除由index指定的Item。完成后触发{@link #re...
从集合中移除由index指定的Item。完成后触发{@link #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
(
String/Number key
)
: Object
根据key或索引(index)返回item。key的优先权高于索引。
...
根据key或索引(index)返回item。key的优先权高于索引。
这个方法相当于先调用{@link #key},如不匹配在调用{@link #itemAt}。
参数项:
|
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
(
[*/ ],
[Function fn]
)
按传入的函数排列集合
按传入的函数排列集合
参数项:
|
MixedCollection | |
keySort
(
[*/ ],
[Function fn]
)
按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 | |
Ext.util.MixedCollection.prototype.get
(
String/Number key
)
: Object
根据key或索引返回item。key的优先权高于索引。
@method
根据key或索引返回item。key的优先权高于索引。
@method
参数项:
|
MixedCollection | |