체크 상자가 있고 검색 기능을 지원하는 드롭다운 목록 2

2134 단어 extJ#

// private
    onRender : function(ct, position)
    {
        Ext.form.ComboBox.superclass.onRender.call(this, ct, position);
        var disValue = "";
        if (this.hiddenName)
        {
            this.hiddenField =
                    this.el.insertSibling({tag:'input', type:'hidden', name: this.hiddenName, id: (this.hiddenId || this
                            .hiddenName)}, 'before', true);
            var hvalue = this.hiddenValue !== undefined ? this.hiddenValue : this.value !== undefined ? this.value : '';
            var hvalueArray = hvalue.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)
                    {
                        disValue += newValue + this.displaySeparator;
                    }
                }

            }
            this.hiddenField.value =
                    this.hiddenValue !== undefined ? this.hiddenValue : this.value !== undefined ? this.value : '';
            this.el.dom.removeAttribute('name');
        }
        if (Ext.isGecko)
        {
            this.el.dom.setAttribute('autocomplete', 'off');
        }

        if (!this.lazyInit)
        {
            this.initList();
        }
        else
        {
            this.on('focus', this.initList, this, {single: true});
        }

        if (!this.editable)
        {
            this.editable = true;
            this.setEditable(false);
        }
        this.setValue(disValue);
    },

좋은 웹페이지 즐겨찾기