ASPX:
<script type="text/javascript">
function OnVesselCodeChange(VesselCode)
{
cbVoyageSearch.PerformCallback(VesselCode.GetValue().toString()) ; //服务回调。
}
function ClearSearchCtrlValue()
{
cbVoyageSearch.SetValue("");
tbBLNoSearch.SetValue("");
cbVesselCodeSeach.SetValue("");
}
</script>
<dx:ASPxComboBox id="cbVesselCodeSeach" runat="server" style="left: 57px; position: absolute; top: 12px" ValueType="System.String" ClientInstanceName="cbVesselCode" Width="89px" >
<ClientSideEvents SelectedIndexChanged="function(s, e) {
OnVesselCodeChange(s); //客户端选择某个内容,发生变化时,调用服务器ajax.
}" />
</dx:aspxcombobox>
<dx:ASPxComboBox ID="cbVoyageSearch" runat="server" OnCallback="cbVoyage_Callback" Style="left: 171px;
position: absolute; top: 13px" Width="79px" >
</dx:ASPxComboBox>
CS:
//航次回调。
protected void cbVoyage_Callback(object sender, DevExpress.Web.ASPxClasses.CallbackEventArgsBase e)
{
string sSql = "select CO_VesselCode as 船名,Voyage as 航次,VoyageDescriptionCn as 中文描述,IE as 进出口,SailingDate as 船期,islocked as 锁定," +
"isfinishvessel as 是否完船,ischg as 放箱指令 from view_vesselall where isfinishvessel='N' and SailingDate>sysdate-7 and Co_VesselCode='" +
e.Parameter + "'";
DevGlobal.FillComoboboxBySql(ref cbVoyageSearch, sSql, new string[] { "航次","中文描述"}, "航次", false);
}
|