var dataSource = new kendo.data.DataSource({Hello friends, I'm accessing an ASP.NET WebServices that return JSON. I can see the data correctly from the server to in FireBUG: (See Below)
I am unable to fill my grid with my URL data returned.. What is my mistake?
transport: {
read: {
url: "WebService.asmx/getAllCustomerName",
type: "POST",
contentType: "application/json; charset=utf-8",
dataType: "json"
}
},
schema: {
data: function (data) {
alert(data.d); /*Data Return Successfully*/
return data.d;
}
},
error: function (e) {
alert("Error");
},
change: function (e) {
alert("Change");
},
requestStart: function (e) {
alert("Request Start");
}
});
$("#try").kendoGrid({
dataSource: dataSource, //No data...
pageable: true,
sortable: true,
height: 450,
scrollable: { virtual: true },
selectable: true,
dataBound: function (e) {
alert("DataBound");
},
columns: [
{ field: "CustomerID", title: "CustomerID" },
{ field: "FirstName", title: "FirstName" },
{ field: "LastName", title: "LastName" },
{ field: "BalancePoint", title: "BalancePoint" }
]
});
My URL return data of json type:--
{"d":"[{\"BalancePoint\":\"2017.000\",\"CustomerID\":\"000\",\"FirstName\":\"AA\",\"LastName
\":\"ZX\"}, {\"BalancePoint\":\"224.000\",\"CustomerID\":\"001\",\"FirstName\":\"AB\",\"LastName
\":\"ZY\"}, {\"BalancePoint\":\"1094.000\",\"CustomerID\":\"002\",\"FirstName\":\"AC\",\"LastName
\":\"ZZ\"}
]"}