return false;
});
return false;
});
//绑定当INPUT框中的内容被改变时的事件
if(!this.$readOnly){
if(this.$type=="filter"){//当type=="filter"时
this.$input.bind("change", { inthis: this }, function (e) {
var inthis = e.data.inthis;
//var text=""+this.value;
var text = $.trim(this.value)
var data = inthis.$data;
var temp = "";
if (inthis.$ajaxType) {//如果ajaxType属性有设置,则filter模式下,下拉框控件将在每次change时,动态从获取数据
inthis.$ajaxType.para["search"] = text; //后台需要对REQUEST传入的search变量有一个向前模糊匹配的查询功能
inthis.loadListDataAjax();
}
else {
for (var i = 0; i < data.length; ++i)
{
if (data[i][1].indexOf(text) == 0)
temp +="<a href='#'><p " + (inthis.$haveIcon ? "style='text-indent:19px;background:" + data[i][2] + "' " : "") + "value='" + data[i][0] + "'>" + data[i][1] + "</p></a>";
}
inthis.$list.empty();
inthis.$list.append(temp);
}
});
}
else{
this.$input.bind("change", { inthis: this }, function (e) {
var text = this.value;
var inthis = e.data.inthis;
var data = e.data.inthis.$data;
for (var i = 0; i < data.length; ++i) {
if (data[i][1] == text) {
if (inthis.$lastSelect)
inthis.$lastSelect.removeClass("active");
inthis.$lastSelect = inthis.$list.children("a:eq(" + i + ")").addClass("active");
now = inthis.$list.children("a:eq(" + i + ")").children("p");
inthis.$select.val(data[i][0]);
if (inthis.$haveIcon) {
$(this).parent(".text").css({
background: now.css("background"),
"background-image": "url(../images/combo_icon.gif)",
"background-position": now.css("background-position"),
"background-repeat": now.css("background-repeat")
});
}
break;
}
}
});
}
var once=null;
this.$input.bind("keyup", { input: this.$input, list: this.$list }, function (e) {
if (!e) e = window.event;
if (e.keyCode == 13)
e.data.list.css("display", "none");
else if (e.keyCode == 40) {
var temp = e.data.list.children("a:eq(0)");
temp.focus();
temp.toggleClass("focus");
}
else {
//alert("进入keyup");
once = null;
once = setTimeout(function () { e.data.input.change(); }, 500);
}
});
}
//绑定下拉按钮的事件
this.$btn.bind("mousedown",function(){
inthis=$(this);
inthis.removeClass("btn_up");
inthis.addClass("btn_down");
});
this.$btn.bind("mouseup",{input:this.$input},function(e){
inthis=$(this);
inthis.removeClass("btn_down");










