AddList to QuickLaunch

Oct 26, 2013 at 5:38 PM
I have a function to create a list but I'm not sure how to get this list to show up on the quick launch.

I found this discussion on this topic but I don't know how to implement it: https://spservices.codeplex.com/discussions/287159
function createList(){
  if(!siteUrl){
    alert("You must first select a site");
    return;
  }
  var listName = $('#listName');
  var listDesc = $('#listDesc');
  var listTemp = $('#listTemplate');
  var siteLists = $('#web_siteLists');
  console.log(siteUrl+" - "+listName+" - "+listDesc+" - "+listTemp);
  $().SPServices({
    operation:"AddList",
    webURL: siteUrl,
    listName: listName.val(),
    description: listDesc.val(),
    templateID: listTemp.find(':selected').val(),
    OnQuickLaunch: true,
    completefunc: function(xData, Status){
      if($(xData.responseXML).find('faultcode').length > 0){
        alert('Please fill form correctly');
        return;
      }else{
        alert(listName.val()+" created.");
        siteLists.empty();
        RefreshSiteList(siteUrl);
        listName.val('');
        listDesc.val('');
        listTemp.val('default');        
      }
    }
  });
}
Oct 26, 2013 at 7:04 PM
What version if SP?

Also, just to clarify: you want a link on the quick launch area that when Ickes by a user, your function above will run. Is correct?



--

_________
Paul T

Oct 26, 2013 at 9:54 PM
Edited Oct 26, 2013 at 10:27 PM
Version 2010 Foundation.
Not exactly. I have a form to add new lists but the new lists aren't showing up in the quick launch after they are created. I have to go to All site content to find them
Coordinator
Oct 28, 2013 at 2:36 PM
SimK:

I just tested this in my WSS environment and it worked:
$().SPServices({
  operation: "UpdateList",
  listName: "Sales Opportunities",
  listProperties: "<List OnQuickLaunch='TRUE' />"
});
Unfortunately, I don't see the OnQuickLaunch property documented on the MSDN page for the operation (http://msdn.microsoft.com/en-us/library/lists.lists.updatelist.aspx), but it's mentioned in a comment.

M.
Oct 28, 2013 at 4:55 PM
Thanks for the reply Mark, I guess there's no way to enable this during the creation eh. That seems strange considering you can through SP. Anyways, thanks again.