读书人

带复选框且支持搜索功能的上拉列表13

发布时间: 2012-10-06 17:34:01 作者: rapoo

带复选框且支持搜索功能的下拉列表13

// private    getParams : function(q)    {        var p = {};        //p[this.queryParam] = q;        if (this.pageSize)        {            p.start = 0;            p.limit = this.pageSize;        }        return p;    },    /**     * Hides the dropdown list if it is currently expanded. Fires the 'collapse' event on completion.     */    collapse : function()    {        if (!this.isExpanded())        {            return;        }        this.list.hide();        Ext.getDoc().un('mousewheel', this.collapseIf, this);        Ext.getDoc().un('mousedown', this.collapseIf, this);        this.fireEvent('collapse', this);    },    // private    collapseIf : function(e)    {        if (!e.within(this.wrap) && !e.within(this.list))        {            this.collapse();        }    },    /**     * Expands the dropdown list if it is currently hidden. Fires the 'expand' event on completion.     */    expand : function()    {        if (this.isExpanded() || !this.hasFocus)        {            return;        }        this.list.alignTo(this.wrap, this.listAlign);        var hvalueArray = this.hiddenField.value.split(this.valueSeparator);        for (var i = 0; i < this.store.data.length; i++)        {            var r = this.store.getAt(i);            var newValue = r.data[this.displayField];            var v = r.data[this.valueField];            for (var j = 0; j < hvalueArray.length; j++)            {                if (hvalueArray[j] == v)                {                    document.getElementById("checkBox_" + newValue).className = "checked";                }            }        }        this.list.show();        Ext.getDoc().on('mousewheel', this.collapseIf, this);        Ext.getDoc().on('mousedown', this.collapseIf, this);        this.fireEvent('expand', this);    },

读书人网 >Web前端

热点推荐