自定义sharepoint 2010 xslt列表-通过编辑后未刷新的数据编辑项目

Custom sharepoint 2010 xslt list - Edit item via Data not refreshed after edit

本文关键字:编辑 刷新 项目 数据 2010 sharepoint xslt 列表 -通 自定义      更新时间:2023-09-26

我使用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>

这是一个相关的帖子:如何编辑另一页上的列表项

问题

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

因此,单击保存按钮后,信息会在SharePoint中更新,但模式div会被隐藏,页面信息永远不会更新。

欢迎任何帮助。

谢谢,M31

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