DevExpress ASPxCombobox 组件的学习与应用

论坛 期权论坛 编程之家     
选择匿名的用户   2021-5-16 18:52   131   0

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);
    }


分享到 :
0 人收藏
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

积分:3875789
帖子:775174
精华:0
期权论坛 期权论坛
发布
内容

下载期权论坛手机APP