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

时间:2013-08-07 15:26:51

标签: javascript sharepoint xslt sharepoint-2010

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

1 个答案:

答案 0 :(得分:0)

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