KendoCombobox is not fetching Localsource jsondata

大兔子大兔子 提交于 2019-12-13 05:17:22

问题


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.

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({ 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");

回答1:


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

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

here is an example



来源:https://stackoverflow.com/questions/18746379/kendocombobox-is-not-fetching-localsource-jsondata

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!