我不知道怎麼形容的細節,你可以看到一個錯誤在這個視頻: http://www.youtube.com/watch?v=D6NPd-j2erg&feature=youtu.be 這是我使用的代碼:劍道UI電網重複請求服務器錯誤
$(document).ready(function() {
var dataSource = new kendo.data.DataSource({
transport: {
read: {
url: "/customer/get",
dataType: "json",
type: "POST"
},
update: {
url: "/customer/edit",
dataType: "json",
type: "POST"
},
destroy: {
url: "/customer/delete/",
dataType: "json",
type: "POST"
},
create: {
url: "/customer/add",
dataType: "json",
type: "POST"
}
},
batch: false,
pageSize: 20,
serverPaging: true,
serverFiltering: true,
serverSorting: true,
schema: {
data: "Data",
total: "Total",
model: {
id: "CustomerId",
fields: {
CustomerId: { editable: false, nullable: true },
Name: { validation: { required: true } },
Code: { type: "string", editable: false }
}
}
}
});
$("#grid").kendoGrid({
dataSource: dataSource,
height: 430,
filterable: true,
sortable: true,
pageable: {
refresh: true,
pageSizes: [10, 20, 30],
buttonCount: 10
},
toolbar: ["create"],
columns: [
{ field: "Name", title: "Name" },
{ field: "Code", title: "CODE", width: "100px" },
{ command: ["edit", "destroy"], title: " ", width: "200px" }],
editable: "popup"
});
});
我犯了什麼錯誤嗎? 我已經加入了劍道UI庫如下:
<script src="/Scripts/kendo/2013.1.319/jquery.min.js"></script>
<script src="/Scripts/kendo/2013.1.319/kendo.all.min.js"></script>
<script src="/Scripts/kendo/2013.1.319/kendo.aspnetmvc.min.js"></script>
<script src="/Scripts/kendo.modernizr.custom.js"></script>
這很好,非常感謝。 我不能投你的答案,因爲它需要15聲望,但無論如何,我也感謝。我爲此丟了2天 – TuanPM 2013-03-27 13:15:10
你好Petur,我得到了和你一樣的回覆。但是我面臨着同樣的問題。這意味着我的CRUD操作多次發射。 – Pawan 2014-02-13 09:46:22
@ Pawan如果使用最新版本並且已經實現瞭如下所示的CRUD:http://docs.telerik.com/kendo-ui/getting-started/using-kendo-with/aspnet-mvc/helpers/grid/ajax - 編輯 然後你不應該面對任何問題。 – 2014-02-17 11:57:04