ModalDialog 关闭时 ASP GridView 自动更新

发布于 2025-01-08 12:49:08 字数 1022 浏览 3 评论 0原文

我有一个带有搜索和过滤选项的 gridView,它列出了 SharePoint 库中的文档,当我单击文档名称时,我添加了一个模态弹出窗口来显示文档属性页面,例如,如果我更新文档的标题并选择保存,则该项目为已更新,但 gridview 仍然显示旧标题,我需要再次按“搜索”才能刷新值。 在此处输入图像描述

在此处输入图像描述

在此处输入图像描述

在此处输入图像描述

我用于模型弹出窗口的代码是:

<script type="text/javascript">

    function openModal(url) {
        var options = SP.UI.$create_DialogOptions();
        options.url = url;
        options.dialogReturnValueCallback = Function.createDelegate(null, CloseCallback);
        SP.UI.ModalDialog.showModalDialog(options);
    }

    // Dialog callback 
    function CloseCallback(result, target) {
        if (result === SP.UI.DialogResult.OK) {

            SP.UI.ModalDialog.RefreshPage(SP.UI.DialogResult.OK);
        }
    }
  </script>

当弹出窗口关闭时,我应该如何刷新和出价 gridview 数据?

I have a gridView with search and filtering options, it is listing document from SharePoint Library, when i click on the Document name i added a Modal popup to display Documents properties page, if i update Document's title for example and select save, the item is updated but the gridview is still showing the old title, i need to press Search again in order to refresh the values.
enter image description here

enter image description here

enter image description here

enter image description here

the code i use for model popup is:

<script type="text/javascript">

    function openModal(url) {
        var options = SP.UI.$create_DialogOptions();
        options.url = url;
        options.dialogReturnValueCallback = Function.createDelegate(null, CloseCallback);
        SP.UI.ModalDialog.showModalDialog(options);
    }

    // Dialog callback 
    function CloseCallback(result, target) {
        if (result === SP.UI.DialogResult.OK) {

            SP.UI.ModalDialog.RefreshPage(SP.UI.DialogResult.OK);
        }
    }
  </script>

what should i do to refresh and bid gridview data when the popup is closed?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

樱桃奶球 2025-01-15 12:49:09

单击“保存”按钮时,进行服务器端调用以重新绑定网格视图。 ie

$(document).ready(function(){
    $('id_of_save_button').click(function(){
          //ajax call of serverside method to rebind the grid.
    });
});

然而,对于 asp.net,如果您使用 asp.net 附带的 modalPopupExtender,这些事情就会变得不那么容易

on the click of save button, make a serverside call to rebind the gridview. i.e

$(document).ready(function(){
    $('id_of_save_button').click(function(){
          //ajax call of serverside method to rebind the grid.
    });
});

However with asp.net these things become little easy if you use modalPopupExtender that ships with asp.net

静水深流 2025-01-15 12:49:09

您好,使用 javascript 处理共享点保存事件,您可以使用此函数

function PreSaveAction() 
 {
   // write your gride view data bind code
 }

Hi for handling sharepoint save event using javascript u can use this function

function PreSaveAction() 
 {
   // write your gride view data bind code
 }
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文