KendoCombobox没有获取Localsource jsondata [英] KendoCombobox is not fetching Localsource jsondata
问题描述
我正在为项目使用KendoUi.我创建了本地wcf服务,并且效果很好.我在浏览器上测试过,它给出了jsondata.但是我无法将数据提取到组合框中的aspx页面.
I am using KendoUi for my project. i created local wcf service and it works well. i tested on the browser and it gives jsondata. but i cannot fetch the data to the aspx page in combobox.
我的kendocombobox的JavaScript代码如下.请尽快帮助我. 请使用localhost代替www.google.com
my javascript code for the kendocombobox is below. please help me as soon as possible. please use localhost in place of www.google.com
var ds = new kendo.data.DataSource({ 运输: { 类型:"json", 读: { url:" http://www.google.com:2608/Service1.svc/getAllProducts " } }, 总计:[{字段:"ProductID",总计:"sum"}] });
var ds = new kendo.data.DataSource({ transport: { type: "json", read: { url: "http://www.google.com:2608/Service1.svc/getAllProducts" } }, aggregate: [{ field: "ProductID", aggregate: "sum"}] });
$("#regBody").kendoComboBox({
placeholder: "Select Product",
dataTextField: "ProductName",
dataValueField: "ProductID",
dataSource: ds
}).data("kendoComboBox");
推荐答案
不确定到底什么不起作用-需要将哪些内容提取到服务器?如果它是一个组合框,则假定您要获取在框中输入的数据,以便服务器将过滤后的结果发送给您.您需要添加
No sure what exactly doesn't work - what needs to be fetched to server? If it is a Combobox I assume you want to fetch data entered in the box so the server sends you back filtered result. you need to add
serverFiltering: true
到yourDatasource. 如果您只想获取最终值并对其进行处理,则可以使用一个简单的Ajax调用来完成它
to yourDatasource. If you want just fetch the final value and do something with it you can use a simple Ajax call to do it
这是一个示例
这篇关于KendoCombobox没有获取Localsource jsondata的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!