首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 网站开发 > Web前端 >

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

2012-10-19 
带复选框且支持搜索功能的下拉列表10// privateonEmptyResults : function(){this.collapse()},/*** Retu

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

// private    onEmptyResults : function()    {        this.collapse();    },    /**     * Returns true if the dropdown list is expanded, else false.     */    isExpanded : function()    {        return this.list && this.list.isVisible();    },    selectByValue : function(v, scrollIntoView)    {        if (v !== undefined && v !== null)        {            var r = this.findRecord(this.valueField || this.displayField, v);            if (r)            {                this.select(this.store.indexOf(r), scrollIntoView);                return true;            }        }        return false;    },    select : function(index, scrollIntoView)    {        this.selectedIndex = index;        this.view.select(index);        if (scrollIntoView !== false)        {            var el = this.view.getNode(index);            if (el)            {                this.innerList.scrollChildIntoView(el, false);            }        }    },    // private    selectNext : function()    {        var ct = this.store.getCount();        if (ct > 0)        {            if (this.selectedIndex == -1)            {                this.select(0);            } else if (this.selectedIndex < ct - 1)            {                this.select(this.selectedIndex + 1);            }        }    },    // private    selectPrev : function()    {        var ct = this.store.getCount();        if (ct > 0)        {            if (this.selectedIndex == -1)            {                this.select(0);            } else if (this.selectedIndex != 0)            {                this.select(this.selectedIndex - 1);            }        }    },    // private    onKeyUp : function(e)    {            if (this.editable !== false)        {            this.lastKey = e.getKey();            this.dqTask.delay(this.queryDelay);        }    },    // private    validateBlur : function()    {        return !this.list || !this.list.isVisible();    },    // private    initQuery : function()    {        this.doQuery(this.getRawValue());    },    // private    doForce : function()    {        if (this.el.dom.value.length > 0)        {            this.el.dom.value = this.lastSelectionText === undefined ? '' : this.lastSelectionText;            this.applyEmptyText();        }    },

热点排行