gpt4 book ai didi

javascript - 使用 KendoGrid 进行批量编辑时如何弹出 "Successfully Saved"消息?

转载 作者:行者123 更新时间:2023-11-28 20:45:20 25 4
gpt4 key购买 nike

我正在使用 KendoUI 网格进行在线批量编辑。我想在成功保存更改后向用户显示一条消息。我该怎么做?

我的加价:

<div id="employeeGoalsGrid"></div>

我的 JavaScript:

var goalsDataSource = new kendo.data.DataSource({
transport: {
read: {
url: '/MVC/ResearcherPoints/GetEmployeeResearchers',
type: 'POST',
contentType: 'application/json'
},
update: {
url: '/MVC/ResearcherPoints/UpdateEmployeeGoal',
type: 'POST',
contentType: 'application/json'
//dataType: "jsonp"
},
parameterMap: function (options, type) {
debugger;
$.extend(options, { ID: options.id });
return JSON.stringify(options);
}
},
batch: false,
schema: {
model: {
id: 'ID',
fields: {
id: { editable: false, nullable: false },
FirstName: { editable: false, nullable: true },
LastName: { editable: false, nullable: true },
Title: { editable: false, nullable: true },
TeamName: { editable: false, nullable: true },
PointsGoal: { type: "number", nullable: true, validation: { required: false, min: 1 } }
}
}
},
sortable: true,
filterable: true,
columnMenu: true
});


$('#employeeGoalsGrid').kendoGrid({
dataSource: goalsDataSource,
navigatable: true,
sortable: true,
resizable: true,
toolbar: ["save", "cancel"],
columns: [
{ field: "FirstName", title: "First Name", width: 200},
{ field: "LastName", title: "Last Name", width: 200 },
{ field: "Title", title: "Title", width: 200 },
{ field: "TeamName", title: "Team", width: 200 },
{ field: "PointsGoal", title: "Goal", width: 200 }],
editable: true,
filterable: true,
});

最佳答案

罗德尼,利用整个事件怎么样?我同意,这有点肮脏,但我从未成功举办过剑道事件(不确定是否有人成功过——剑道?)。

 update: {
url: '/MVC/ResearcherPoints/UpdateEmployeeGoal',
type: 'POST',
contentType: 'application/json',
complete: function (jqXhr, textStatus) {
if (textStatus == 'success') {
var result = jQuery.parseJSON(jqXhr.responseText);
// read your result
// open your dialog
}
}
},

关于javascript - 使用 KendoGrid 进行批量编辑时如何弹出 "Successfully Saved"消息?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13569676/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com