combobox下拉框级联并且每一个框默认选择第一个值使用onLoadSuccess——easyUI

来源:互联网 发布:中宣部知乎 编辑:程序博客网 时间:2024/06/05 07:08
/*
* 下拉框级联
*/
$('#input_add_checkfilehisotry_jz').combobox({
   url:'${pageContext.request.contextPath}/machineType/getAllMachineTypelist',
   panelHeight:'auto',
   onChange:function(machineId){
     $('#input_add_checkfilehisotry_gc').combobox({
     url:'${pageContext.request.contextPath}/Engineering/getAllEngineeringlist?machineTypeId='+machineId,
     panelHeight:'auto',
     onLoadSuccess : function(){ 
  var data = $('#input_add_checkfilehisotry_gc').combobox('getData');
  $("#input_add_checkfilehisotry_gc ").combobox('select',data[0].id);
  } ,
     onChange:function(eneeringId){
     $('#input_add_checkfilehisotry_processes').combobox({
         url:'${pageContext.request.contextPath}/Processes/getAllProcesseslist?machineTypeId='+machineId + '&eneeringId='+ eneeringId,
         panelHeight:'auto',
         onLoadSuccess : function(){ 
     var data = $('#input_add_checkfilehisotry_processes').combobox('getData');
     $("#input_add_checkfilehisotry_processes ").combobox('select',data[0].id);
     }   
     });
     }      
});
   },
onLoadSuccess : function(){ 
var data = $('#input_add_checkfilehisotry_jz').combobox('getData');
$("#input_add_checkfilehisotry_jz ").combobox('select',data[0].id);
}  
})
0 0
原创粉丝点击