有一个简单的剑道网格,带有编辑和销毁命令。
编辑命令显示一个弹出窗口,我可以在其中修改我的数据。我需要自定义编辑窗口的标题和按钮文本(更新和取消按钮)。这是我的代码:
var ds = createJSONDataSource();
function createJSONDataSource() {
var dataSource = new kendo.data.DataSource({
transport: {
autoSync: true,
read: {
type: "POST",
url: "WebServices/GetDataTest.asmx/getCustList",
dataType: "json",
contentType: mime_charset
}
},
pageSize: 5,
schema: {
data: function (data) {
if (data) {
if (serverSelectReturnsJSONString)
return $.parseJSON(data.d);
else
return data.d;
}
},
model:{
id: "customer_id",
fields: {
customer_id: { type: "string", editable: false },
name_customer: { type: "string" },
address_customer: { type: "string" }
}
}
});
var grid = $("#grid").kendoGrid({
selectable: true,
theme: "metro",
dataSource: ds,
scrollable: {
virtual: true
},
reorderable: true,
resizable: true,
pageable: true,
height: 300,
toolbar: ["save", "cancel"],
columns: [
{ field: "customer_id", title: "ID" },
{ field: "name_customer", title: "Cliente" },
{ field: "address_customer", title: "Indirizzo" },
{ field: "PI_customer", title: "Partita IVA", hidden: true },
{ field: "cap_customer", title: "CAP", hidden: true },
{ field: "city_customer", title: "Città" },
{ field: "state_customer", title: "Nazione", selected: false },
{ command: ["edit", "destroy"], title: " " }
],
filterable: true,
editable: "popup",
sortable: true,
columnMenu: {
messages: {
columns: "Scegli colonne",
filter: "Applica filtro",
sortAscending: "Ordina (ASC)",
sortDescending: "Ordina (DESC)"
}
},
groupable: {
messages: {
empty: "Trascina la colonna qui..."
}
}
});
希望有人帮助我!
提前致谢。