1

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));
 }

誰かが私を助けることができますか?

ありがとう 。

4

1 に答える 1

0

それは文脈の問題でした。clientContextとquickLaunchNodeCollectionのコンテキストは同じではないため、nodeToRemoveを削除することはできません。

于 2013-01-22T22:51:31.050 に答える