我使用劍道電網,但我有一個問題,我不能夠到我的網綁定與web服務數據plz幫助我綁定劍道電網與web服務
我的Web服務這個樣子的
[WebMethod]
public string GetCustomers()
{
string data = default(string);
using (var documentStore = new DocumentStore { Url = "http://haseeb-pc:8080/" }.Initialize())
{
using (var session = documentStore.OpenSession())
{
var query = session.Query<Customer>().Select(customer => new
{
FirstName = customer.FirstName,
LastName = customer.LastName,
Email = customer.Email,
}).Take(20);
var serializer = new JavaScriptSerializer();
return serializer.Serialize(query);
}
}
}
和我有有一個div
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title></title>
<script src="../Scripts/jquery-1.7.min.js" type="text/javascript"></script>
<script src="../Scripts/KendoScript.js" type="text/javascript"></script>
<script src="../Scripts/KendoScripts/kendo.all.min.js" type="text/javascript"></script>
<link href="../Scripts/styles/kendo.common.min.css" rel="stylesheet" type="text/css" />
<link href="../Scripts/styles/kendo.default.min.css" rel="stylesheet" type="text/css" />
<script src="../Scripts/KendoScripts/kendo.web.min.js" type="text/javascript"></script>
</head>
<body>
<div id="CustomerGridView">
</div>
</body>
</html>
現在終於我的腳本文件,這是一個HTML頁面:
$(function() {
alert("Welcome To Kendo");
var dataSource = new kendo.data.DataSource(
{
transport: {
read: {
contentType: "application/json; charset=utf-8",
type: "POST",
dataType: "json",
url: "/CustomerService.asmx/GetCustomers"
}
},
pageSize: 10,
schema: {
data: "d"
}
});
alert(dataSource);
$("#CustomerGridView").kendoGrid({
dataSource: dataSource,
height: 250,
scrollable: true,
sortable: true,
pageable: true,
columns: [
{ field: "FirstName", title: "First Name" },
{ field: "LastName", title: "Last Name" },
{ field: "Email", title: "Email" }
],
editable: "popup",
toolbar: ["create"]
});
});
我的問題是我的劍道電網不具約束力plz幫助我結合我網
網格腳本包含了兩次 - kendo.all.min.js和kendo.web。 min.js. – 2012-03-29 05:56:18