簡體   English   中英

使用Java腳本刪除Sharepoint 2010上的Quicklaunch節點

[英]Using Javascript to remove quicklaunch node on sharepoint 2010

我正在嘗試使用javascript客戶端對象模型動態刪除SharePoint 2010(SandBoxed)中的Quicklaunch項目。

該代碼正確運行。 所選項目已從當前的quickLaunchNodeCollection中刪除,但是當我重新加載quickLaunchNodeCollection時,所選項目仍然存在。

function RemoveQuickLaunchNode() {
  var clientContext = new SP.ClientContext('/');
  this.nodeToRemove = this.quickLaunchNodeCollection.get_item(8);
  this.nodeToRemove.deleteObject();

  clientContext.executeQueryAsync(Function.createDelegate(this, this.onRefresh), Function.createDelegate(this, this.Failedmsg));
 }

有人可以幫助我嗎?

謝謝 。

這是一個上下文問題。 clientContext和quickLaunchNodeCollection的上下文不同,因此無法刪除nodeToRemove。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM