سؤال

I'm trying to remove dynamicaly a Quicklaunch item in SharePoint 2010 (SandBoxed) using javascript Client object Model.

The code runs correctly. The selected item is deleted from my current quickLaunchNodeCollection but when I reload my quickLaunchNodeCollection the selected item is still existing.

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

Someone can help me ??

Thanks .

هل كانت مفيدة؟

المحلول

It was a context problem. clientContext and quickLaunchNodeCollection have not the same context, so nodeToRemove can't be deleted.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top