Quantcast
Channel: SharePoint 2013 - Development and Programming forum
Viewing all articles
Browse latest Browse all 7589

Getting specific lists out of App

$
0
0

I found how it's possible to get all lists out of my SharePoint app but i want to filter them on document libraries.

My code below:

    var context = SP.ClientContext.get_current();
    var lists = context.get_web().get_lists();
    context.load(lists, 'Include(RootFolder)');
    context.executeQueryAsync(function () {
        var enumerator = lists.getEnumerator();
        while (enumerator.moveNext()) {
            var list = enumerator.get_current();
            var rootFolder = list.get_rootFolder();

            var url = rootFolder.get_serverRelativeUrl();
            var title = rootFolder.get_name();

            $("#selAgenda").append(new Option(title, title, false, false));
        }
    },
    function (sender, args) {
        console.log('error');
    });

Is it possible to filter out the document libraries?


Viewing all articles
Browse latest Browse all 7589

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>