是否有一种方法可以在ASP.NET MVC Telerik中计算未保存的列单元格,然后在用户未在10行之后保存时创建一个弹出窗口
目前,我正在尝试计算用户编辑的未保存列的数量,以便弹出窗口会提醒他们保存或定期生成弹出消息。
我的问题是,我似乎无法使它工作大声笑,我可以创建弹出窗口,并且在打开或刷新时加载它,但是当我超过10个代码所要求时,它不会打开。实际上,我没有能够获得任何控制台。
<script>
function onClose() {
//$("#showDialogBtn").fadeIn();
}
function onOpen() {
// $("#showDialogBtn").fadeOut();
}
function showDialog() {
/*
The general idea here is that you count the total number of
unsaved columns before you release the show dialog
*/
$('#dialog').data("kendoDialog").open();
var ucc; // create total unsaved column count
var grid = $('#Grid').data("kendoGrid");
var gridData = grid.dataSource.view();
for (var i = 0; i < gridData.length; i++) {
(ucc += gridData[i].eTmfCompletenessComment);
}
if (ucc >= 10) {
$('#dialog').data("kendoDialog").open();
// $("#showDialogBtn").fadeOut();
}
else {
kendoConsole.log(ucc)
}
}
</script>
Currently I am trying to count the number of unsaved columns a user has edited so that a pop up window will remind them to save or periodically produce the pop up message again.
My problem is i cant seem to get it to work lol, I can create the pop up window and it loads on open or refresh but it doesnt open when i have over 10 like the code is asking. Infact I havent been able to get any console.logs to the console window to debug if its even working and frankly im looking for some help with solving
<script>
function onClose() {
//$("#showDialogBtn").fadeIn();
}
function onOpen() {
// $("#showDialogBtn").fadeOut();
}
function showDialog() {
/*
The general idea here is that you count the total number of
unsaved columns before you release the show dialog
*/
$('#dialog').data("kendoDialog").open();
var ucc; // create total unsaved column count
var grid = $('#Grid').data("kendoGrid");
var gridData = grid.dataSource.view();
for (var i = 0; i < gridData.length; i++) {
(ucc += gridData[i].eTmfCompletenessComment);
}
if (ucc >= 10) {
$('#dialog').data("kendoDialog").open();
// $("#showDialogBtn").fadeOut();
}
else {
kendoConsole.log(ucc)
}
}
</script>
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这就是您将如何注册未保存的更改,然后警报是否有任何更改
This is how you would register unsaved changes and then alert if there are any