自定义下拉框,使用data,将数据列表加载
<input type="text" class="easyui-combobox" style="width:125px" name="materialname" id="materialname"
data-options="valueField:'id',
textField:'text',
data:
[{ 'id':'FPCID',
'text':'FPC解绑' ,
selected:true
},{
'id':'BLUID',
'text':'背光解绑'
},{
'id':'CGID',
'text':'盖板解绑'
},{
'id':'MODULEID',
'text':'喷码解绑'
}] ,panelHeight:'auto'
"/>
选中触发事件:
onSelect 等同于 onChange
$(function(){
$("#materialname").combobox({
onSelect:function(record){
$('#materialid').focus();
}
})
})
或
<input class="easyui-combobox" id="downgrade" name="downgrade" style="width:155px;height:20px;margin:1px;padding:0px;"
data-options="valueField:'id',
textField:'text',
data:
[{ 'id':'LCD',
'text':'LCD降级大箱打包' ,
selected:true
},{
'id':'FOG',
'text':'FOG降级大箱打包'
},{
'id':'LCM',
'text':'LCM降级大箱打包'
}] ,panelHeight:'auto' ,onSelect:function(){getweight();}
"
/>
function getweight(){
var weight = $('#downgrade').combobox('getValue') + 'weight';
$.post('fgcodeManageAction!doPanelQty.action', {
subattributename : weight,
operationcode:'M092'
}, function(data) {
if(data.message=='AREABASE_INDO_FAIL'){
setMssage(data.messageCode);
focusp();
}else{
$("#weight").val(data.vae);
$("#plannedqty").val(data.panelqty);
focusp();
}
});
}