I need to filter result to particular content types fo document library. I cannot seem to retrieve the content type of library. How is this possible. When I try with oList.get_contentTypes() object object is being returned.
function retrieveAllListProperties() {
var clientContext = new SP.ClientContext();
var oWebsite = clientContext.get_web();
this.collList = oWebsite.get_lists();
clientContext.load(collList);
clientContext.executeQueryAsync(
Function.createDelegate(this, this.onQuerySucceeded),
Function.createDelegate(this, this.onQueryFailed)
);
}
function onQuerySucceeded() {
var listInfo = '';
var listEnumerator = collList.getEnumerator();
while (listEnumerator.moveNext()) {
var oList = listEnumerator.get_current();
listInfo += 'Title: ' + oList.get_title() + oList.get_contentTypes() + '\n';
}
alert(listInfo);
}

0 commentaires:
Enregistrer un commentaire