【发布时间】:2015-03-29 23:33:30
【问题描述】:
RadDropDownList 控件绑定到 web 服务。在加载控件填充确定。但我需要在模式窗口关闭后更新项目列表。
用于更新项目列表的 Javascript 函数:
function Templates_RequestData(){
var dropdown = $find("<%= Me.RadDropDownTemplates.ClientID%>");
javascript: console.log(dropdown.get_items()); //works ok
//dropdown.requestItems("", false); - undefined is not a function
//dropdown.reload(); - undefined is not a function
//dropdown.clearItems(); - undefined is not a function
javascript: console.log("reload");
}
RadDropDownList 控件
<telerik:RadDropDownList ID="RadDropDownTemplates" runat="server"
Skin="MetroTouch" Width="100%" DropDownWidth="200px"
AutoPostBack="false"
DefaultMessage=" - select template - "
OnClientItemsRequesting="Templates_OnItemRequesting"
SelectedValue='<%# Me.LastUsedTemplateID%>' >
<WebServiceSettings Path="WebServices/Templates.asmx"
Method="GetAll"/>
</telerik:RadDropDownList>
我尝试的所有方法都会导致错误:
"Uncaught TypeError: undefined is not a function"
javascript: console.log(dropdown) - 返回 RadDropDownList 类型的有效对象。 Telerik 的文档不包含任何使用 Web 服务更新项目的功能。
如何从客户端代码更新raddropdownlist?
【问题讨论】:
-
requestItems() 方法通常在您有按需加载时使用,RadComboBox 就是这种情况。 RadDropDownList 没有按需加载,因此您可能需要使用另一种方法。最好询问 Telerik 支持。
标签: javascript asp.net telerik