【问题标题】:Custom sharepoint 2010 xslt list - Edit item via javascript - Data not refreshed after edit自定义 sharepoint 2010 xslt 列表 - 通过 javascript 编辑项目 - 编辑后数据未刷新
【发布时间】:2013-08-09 01:40:08
【问题描述】:

我使用 xslt 自定义呈现 SharePoint 2010 列表。我创建了每个项目的链接,以便通过 SharePoint 模式对话框弹出 UI 编辑它们。为此,我使用了以下脚本(SP.UI.ModalDialog.showModalDialog 脚本):

function openMyItemDialog( itemId ) {
var options = {
    url: "http://{mysharepointsite}/_layouts/listform.aspx?PageType=4&ListId={D0FDB54F-1DDF-4C5E-865B-ABDE55C1125}&ID=" + itemId + "&ContentTypeID=0x010800ED5176D13CCEFC4AA8D62A79985DE892&IsDlg=1",
    width: 500,
    height: 500,
    title: "Item view/edit"
};
SP.UI.ModalDialog.showModalDialog( options );

}

我用这个调用脚本:

<a href="#" onclick="openMyItemDialog(35)">Test item</a>

这是一个相关的帖子: How to edit list item on another page

问题

这是一个很好的解决方案,但是,您必须考虑的一件事是,如果您编辑一个项目,您必须刷新页面才能看到更新(您刚刚更改的信息)。是否有任何 SharePoint 脚本会在编辑完成并保存后更新页面上的项目?

所以发生的情况是 - 单击保存按钮后,SharePoint 中的信息得到更新,但模态 div 被隐藏,页面信息永远不会更新。

欢迎任何帮助。

谢谢,M31

【问题讨论】:

    标签: javascript sharepoint xslt sharepoint-2010


    【解决方案1】:

    如果它是一个模态窗口,那么您必须监视模态窗口何时关闭(例如使用https://sharepoint.stackexchange.com/questions/65513/detect-modal-dialog-close-with-jquery),然后您可以使用window.location.reload()window.location.href=window.location.href 重新加载您的主页

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2016-11-14
      • 2023-01-31
      • 1970-01-01
      • 2014-05-16
      • 2013-09-08
      • 1970-01-01
      相关资源
      最近更新 更多