能否让我知道如何根据用户是否对“编辑”文本框进行了某些更改来隐藏/显示“保存”按钮,例如,如果未对编辑文本框进行任何更改,则我们应该隐藏“保存”按钮。如果用户对“编辑”文本框进行了任何更改,则应显示“保存”按钮。
网格图像:
这是我的代码:
$(function() {
$("#grid").kendoGrid({
dataSource: new kendo.data.DataSource({
data: [{ SystemName: "SysTest", SystemID: "789" }],
serverPaging: false,
serverSorting: false,
serverFiltering: false,
batch: true,
/*filter: { logic: 'and', filters: [] }, //set the default it is passed as a value
sort: [], //set the default it is passed as a value */
schema: {
//data: "Items",
model: {
id: "SystemID",
fields: {
SystemName: { editable: true, nullable: true, type: "string" },
SystemID: { editable: false, nullable: false },
}
}
}
}),
columns: [
{
field: "SystemName",
title: "Some Name",
horizontalAlign: "left",
headerAttributes: { style: "text-align: left; width: 75%;" },
width: '45%',
encoded: false,
name: "SystemName"
}, {
field: "SystemID",
title: "SystemID",
horizontalAlign: "left",
headerAttributes: { style: "text-align: left; width: 75%;" },
width: '25%',
encoded: false,
name: "SystemID"
},
{
command: [{
name: "edit",
text: {
edit: "Edit", // This is the localization for Edit button
update: "Save", // This is the localization for Update button
cancel: "Cancel" // This is the localization for Cancel button
}
}], title: " ", width: "50%"
}],
editable: "inline",
sortable: false,
resizable: true,
autoBind: true,
navigateHierarchyCell: true,
persistSelections: true,
pageable: false,
autoResizeHeight: false
}).data('kendoGrid');
});
答案 0 :(得分:0)
这是我的答案-
change: function (e) {
$(".k-grid-update").show();
}