WebCombo动态绑定到WebService

作者:控件中国网   出处:控件中国网   2015-07-29 10:53:46   阅读:8

这篇文章主要介绍如何绑定WebCombo使用客户端事件绑定到WebService,同样描述了当绑定到WebService时如何进行刷新,WebCombo可以使用多种方法灵活地绑定数据,具体如下:
function OnAfterItemSelected(controlId) {
    var WebCombo1 = ISGetObject(controlId);
    var WebCombo2 = ISGetObject('WebCombo2');
   
    if (WebCombo1.Value == "Suppliers") {
        WebCombo2.ClientBindingSettings.ServiceMethods.SelectMethod = "GetSuppliers";
        WebCombo2.DataTextField = "CompanyName";
        WebCombo2.DataValueField = "SupplierID";
    }
    else if (WebCombo1.Value == "Customers") {
        WebCombo2.ClientBindingSettings.ServiceMethods.SelectMethod = "GetCustomers";
        WebCombo2.DataTextField = "ContactName";
        WebCombo2.DataValueField = "CustomerID";
    }
    WebCombo2.IsDirty = true;
    WebCombo2.NeedClearList = true;
    WebCombo2.Values = null;
    WebCombo2.ClearSelection();
    WebCombo2.RefreshValueItems();
    return true;
}

Copyright© 2006-2015 ComponentCN.com all rights reserved.重庆磐岩科技有限公司(控件中国网) 版权所有 渝ICP备12000264号 法律顾问:元炳律师事务所
客服软件
live chat