⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 ext.util.mixedcollection.html

📁 Ext中文API,学习ext的同志只要你学会ext里的一种控件后其实其他的就大同小异了
💻 HTML
📖 第 1 页 / 共 5 页
字号:
<!--Mock<link rel="stylesheet" type="text/css" href="http://localhost/ext/resources/css/ext-all.css" /><link rel="stylesheet" type="text/css" href="http://localhost/ext/doc/resources/docs.css"/><link rel="stylesheet" type="text/css" href="http://localhost/ext/doc/resources/style.css"/>--><style type="text/css">    body {        overflow: scroll;    }    /**	 .mdesc .long {        display: block;    }     */</style><!-- End Mock--><meta http-equiv="Content-Type" content="text/html; charset=utf-8" /><div class="body-wrap">    <div class="top-tools">        <a class="inner-link" href="#Ext.util.MixedCollection-props"><img src="/images/s.gif" class="item-icon icon-prop">Properties</a><a class="inner-link" href="#Ext.util.MixedCollection-methods"><img src="/images/s.gif" class="item-icon icon-method">Methods</a><a class="inner-link" href="#Ext.util.MixedCollection-events"><img src="/images/s.gif" class="item-icon icon-event">Events</a><a class="inner-link" href="#Ext.util.MixedCollection-configs"><img src="/images/s.gif" class="item-icon icon-config">Config Options</a><a class="bookmark" href="../docs/?class=Ext.util.MixedCollection"><img src="/images/s.gif" class="item-icon icon-fav">Direct Link</a>    </div><h1>Class Ext.util.MixedCollection</h1>    <table cellspacing="0">        <!--        <tr>        <td class="label">        Package:        </td>        <td class="hd-info">        </td>        </tr>        -->        <tr>            <td class="label">                Defined In:            </td>            <td class="hd-info">                MixedCollection.js            </td>        </tr>        <tr>            <td class="label">                Class:            </td>            <td class="hd-info">                Ext.util.MixedCollection            </td>        </tr>        <tr>            <td class="label">                Extends:            </td>            <td class="hd-info">                Object            </td>        </tr>    </table>    <div class="description">        一个负责维护数字下标(numeric indexes)和键值(key)的集合类,并暴露了一些事件    </div>    <div class="hr">    </div>    <a id="Ext.util.MixedCollection-configs"></a>    <h2>配置项</h2>                这个类没有配置项。    	<a id="Ext.util.MixedCollection-props"></a>    <h2>公告属性</h2>                这个类没有公告属性。        <a id="Ext.util.MixedCollection-methods"></a>    <h2>公共方法</h2>            <table cellspacing="0" class="member-table">            <tr>                <th class="sig-header" colspan="2">                    方法                </th>                <th class="msource-header">                    定义者                </th>            </tr>                            <tr class="method-row expandable">                    <td class="micon">                        <a class="exi" href="#expand">&nbsp;</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">                                                MixedCollection                                            </td>                </tr>                            <tr class="method-row expandable">                    <td class="micon">                        <a class="exi" href="#expand">&nbsp;</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">                                                MixedCollection                                            </td>                </tr>                            <tr class="method-row expandable">                    <td class="micon">                        <a class="exi" href="#expand">&nbsp;</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">                                                MixedCollection                                            </td>                </tr>            

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -