vendredi 2 janvier 2015

NAPA retrieves 2 lists



I am retrieving lists using NAPA. The problem is that to whichever site or site collection I add the app, I always receive only



  • Composed Looks

  • Master Page Gallery


This is very few given that a C# or Powershell code ctx.Web.Lists usually returns ca. 10 default ones (Taxonomy, Solution Gallery, Assets, etc.). This leads me to think that the lists queried come from a site created by the app itself:


http://ift.tt/1I5ddL3


I get the same results on all site collections. Full (almost) code:



var context = SP.ClientContext.get_current();
var web = context.get_web();
var lists = web.get_lists();

function listperms()
{
context.load(lists);
context.executeQueryAsync(onlistItemsSuccess, onWebPropsFail);

}

function onlistItemsSuccess(sender, args)
{

var listEnumerator = lists.getEnumerator();
while (listEnumerator.moveNext()) {
// shows the title of the list
}

context.executeQueryAsync();
}


Questions:



  1. How to make the code retrieve all lists in a web?

  2. Why are there only 2 lists in the app site?








0 commentaires:

Enregistrer un commentaire