当前位置: 代码迷 >> JavaScript >> easyui combobox输入长度有关问题
  详细解决方案

easyui combobox输入长度有关问题

热度:158   发布时间:2013-01-21 10:15:38.0
easyui combobox输入长度问题
本帖最后由 liuliu26 于 2013-01-10 17:28:39 编辑
			$('#cc').combobox({
required : true,
url : 'aa.json',
textField : 'text',
valueField : 'id',
mode : 'remote',
method:'post',
panelHeight : 'auto',
width:150,
delay : 500,
value : ''
}


如何实现输入2个以上字符才去读取aa.json

------解决方案--------------------
$('#cc').combobox({                 
required : true,                 
url : 'aa.json',                 
textField : 'text',                 
valueField : 'id',                 
mode : 'remote',                 
method:'post',                 
panelHeight : 'auto',                 
width:150,                 
delay : 500,                 
value : '',
onChange:function(newValue,oldValue){
var options=$(this).combobox("options");
if(newValue.length>2)
options.url='aa.json';
else
options.url='';
}} 


  相关解决方案