船东:
<input class="easyui-combobox"
name="ShipOwner" id="ShipOwner" style = "width:150px;"
data-options="
editable:false,
url:'<%: Url.Content("~/SysModule/Common/GetShipOwnerList") %>',
valueField:'Id',
textField:'CompanyNameCN',
onChange: function(n,o){
var url = '<%: Url.Content("~/SysModule/Ship/GetAllShipListByShipOwner") %>?shipOwnerId='+n;
$('#Ship').combobox('clear');
$('#Ship').combobox('reload', url);
$('#Ship').combobox('clear');
},
panelHeight:'350'" />
船舶:
<input class="easyui-combobox"
name="Ship" id="Ship" style = "width:150px;"
data-options="
url:'<%: Url.Content("~/SysModule/Ship/GetAllShipList")%>',
valueField:'Id',
textField:'ShipNameCN',
panelHeight:'350'" />
============================船舶和航线联动==================
船舶名称
<input class="easyui-combobox" name="ShipName" id="ShipName" style="width: 150px; "
data-options="
url:'<%: Url.Content("~/SysModule/Ship/GetOperatingShipList") %>',
editable:true,
valueField:'Id',
textField:'ShipNameCN',
onChange: function(n,o){
$.DyGet('<%: Url.Content("~/SysModule/Ship/GetShipLineByShipId") %>', { shipId: n },
function (data) {
alert(data)
if(data==1){
$('#ShippingLineType').combobox({disabled:true});
$('#ShippingLineType').combobox('setValues', '1');
}
else{
$('#ShippingLineType').combobox({disabled:false});
}
});
},
panelHeight:'250'" />
配发航线:
<input class="easyui-combobox" name="ShippingLineType" id="ShippingLineType" style="width: 100px;"
data-options="
url:'<%: Url.Content("~/SysModule/Common/GetShippingLineTypeList") %>',
editable:true,
valueField:'Id',
textField:'NameCN',
panelHeight:'150'" />
====================
=如上所述有的时候Onchange事件不好用,则需要写在初始化里面==============
$('#FirstInterViewStatus').combobox({
onChange: function (n, o) {
if (n == '1') {
$('#IsRecommendAgiain').combobox({
disabled: false, //可编辑
required: true //是否是必填
});
}
else {
$('#IsRecommendAgiain').combobox({
disabled: true, //不可编辑
required: false
});
}
}
});