📄 ext.storemgr.html
字号:
<tr class="method-row expandable"> <td class="micon"> <a class="exi" href="#expand"> </a> </td> <td class="sig"> <!--ClassName--><a id="MixedCollection-MixedCollection"></a> <b>MixedCollection</b> ( <code> Boolean allowFunctions, </code> <code> Function keyFn </code> ) : Ext.util.MixedCollection <div class="mdesc"> <div class="short"> 构造器 </div> <div class="long"> 构造器 <div class="mdetail-params"> <strong>参数项:</strong> <ul> <li> <code> allowFunctions </code> : Boolean <div class="sub-desc"> True表示为允许加入函数的引用到集合内(默认为false) </div> </li> <li> <code> keyFn </code> : Function <div class="sub-desc"> 对于一个在该Mixed集合中已保存类型的item,可用这个函数返回对应item的键值。 </div> </li> </ul> <b>返回:</b> <ul> <li> <code> Ext.util.MixedCollection </code> </li> </ul> </div> </div> </div> </td> <td class="msource"> <!--如果这不是同个namespace下--><a ext:cls="Ext.util.MixedCollection" ext:member="#method-MixedCollection" href="output/Ext.util.MixedCollection.html#method-MixedCollection"> MixedCollection </a> </td> </tr> <tr class="method-row expandable"> <td class="micon"> <a class="exi" href="#expand"> </a> </td> <td class="sig"> <!--ClassName--><a id="add-add"></a> <b>add</b> ( <code> String key, </code> <code> Object o </code> ) : Object <div class="mdesc"> <div class="short">
加入一个item到集合中。
</div> <div class="long">
加入一个item到集合中。
<div class="mdetail-params"> <strong>参数项:</strong> <ul> <li> <code> key </code> : String <div class="sub-desc"> item的键名称 </div> </li> <li> <code> o </code> : Object <div class="sub-desc"> 加入的item </div> </li> </ul> <b>返回:</b> <ul> <li> <code> Object </code> 已加入的item </li> </ul> </div> </div> </div> </td> <td class="msource"> <!--如果这不是同个namespace下--><a ext:cls="Ext.util.MixedCollection" ext:member="#method-add" href="output/Ext.util.MixedCollection.html#method-add"> MixedCollection </a> </td> </tr> <tr class="method-row expandable"> <td class="micon"> <a class="exi" href="#expand"> </a> </td> <td class="sig"> <!--ClassName--><a id="getKey-getKey"></a> <b>getKey</b> ( ) : Object <div class="mdesc"> <div class="short">
如果你执行getKey的方法,MixedCollection有一个... </div> <div class="long">
如果你执行getKey的方法,MixedCollection有一个通用的方法来取得keys。
默认的实现只是简单地返回<tt style="font-weight:bold;">item.id</tt>,
不过你可以按照下面的例子自定义一个实现,以返回另外一个值
<pre><code>
// 一般方式
var mc = new Ext.util.MixedCollection();
mc.add(someEl.dom.id, someEl);
mc.add(otherEl.dom.id, otherEl);
//等等
// 使用getKey
var mc = new Ext.util.MixedCollection();
mc.getKey = function(el){
return el.dom.id;
};
mc.add(someEl);
mc.add(otherEl);
// 或通过构造器
var mc = new Ext.util.MixedCollection(false, function(el){
return el.dom.id;
});
mc.add(someEl);
mc.add(otherEl);
</code></pre>
<div class="mdetail-params"> <strong>参数项:</strong> <ul> </ul> <b>返回:</b> <ul> <li> <code> Object </code> 传入item的key </li> </ul> </div> </div> </div> </td> <td class="msource"> <!--如果这不是同个namespace下--><a ext:cls="Ext.util.MixedCollection" ext:member="#method-getKey" href="output/Ext.util.MixedCollection.html#method-getKey"> MixedCollection </a> </td> </tr> <tr class="method-row expandable"> <td class="micon"> <a class="exi" href="#expand"> </a> </td> <td class="sig"> <!--ClassName--><a id="replace-replace"></a> <b>replace</b> ( <code> String key, </code> <code> <span class='optional'>[Object o]</span> </code> ) : Object <div class="mdesc"> <div class="short">
替换集合中的item。完成后触发#replace事件。
</div> <div class="long">
替换集合中的item。完成后触发<a href="###" onClick="alert('#replace');">#replace</a>事件。
<div class="mdetail-params"> <strong>参数项:</strong> <ul> <li> <code> key </code> : String <div class="sub-desc"> 要替换item所关联的那个key,或是item。 </div> </li> <li> <code> o </code> : Object <div class="sub-desc"> </div> </li> </ul> <b>返回:</b> <ul> <li> <code> Object </code> 新的item。 </li> </ul> </div> </div> </div> </td>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -