easyui 動態下拉框
阿新 • • 發佈:2018-12-19
這裡寫程式碼片
function setsecond(){
$("#doWay").combobox('clear');
var stepno = $("#badProduct").datagrid('getSelected').step;
var data0 = [{text:"請選擇",value:"-1"},{text:"讓步接收",value:"3"},{text:"退貨",value:"6"}];
var data1 = [{text:"請選擇",value:"-1"},{text:"返工" ,value:"2"},{text:"讓步接收",value:"3"},{text:"報廢",value:"4"}];
var data2 = [{text:"請選擇",value:"-1"},{text:"挑選",value:"1"},{text:"讓步接收",value:"3"},{text:"報廢",value:"4"}];
var data3 = [{text:"請選擇",value:"-1"},{text:"挑選",value:"1"},{text:"返工",value:"2"},{text:"讓步接收",value:"3"},{text:"報廢" ,value:"4"}];
var data4 = [{text:"請選擇",value:"-1"},{text:"挑選",value:"1"},{text:"報廢",value:"4"}];
if(stepno==''){
data=data0
}
if(stepno=='10'){
data=data1
}
if(stepno=='20'||stepno=='40'||stepno=='60'){
data = data2
}
if (stepno=='30'){
data =data3
}
if(stepno=='50'){
data =data4
}
$("#doWay").combobox({
data : data,
panelHeight:'auto',
});
}
這裡寫程式碼片
<td class="pop_label"><span class="required_mark">*</span>處理方式</td>
<td><select id="doWay" class="easyui-combobox" name="doWay" data-options="editable:false" style="width: 180px; height:30px;">
</select>
</td>