jquery中EasyUI使用技巧小结
combobox组件
一、禁用combobox里面的输入框
$("选择器").combo('textbox').attr("readonly","readonly"); $('选择器').combobox({ editable:false, panelheight:300 });
二、禁用
$('选择器').combobox('disable');
三、获取选项文本和值
$("选择器").combobox("getText")//获取选项文本 $("选择器").combobox("getValue")//获取选项值
四、聚焦自动展开,回车dosometing
$("选择器").focus(function(){ $(this).combo('showPanel'); $(this).combo('textbox').focus(); $($(this).combo('textbox')).unbind("keyup").bind("keyup",function(e){ if(e.keyCode==13){
//dosometing } }); });