Created
January 19, 2014 10:31
-
-
Save vgrem/8503006 to your computer and use it in GitHub Desktop.
Load discussion items from Discussions List
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function getDiscussions(listTitle,OnItemsLoaded,OnError) | |
{ | |
var context = new SP.ClientContext.get_current(); | |
var web = context.get_web(); | |
var list = web.get_lists().getByTitle(listTitle); | |
context.load(list); | |
var qry = SP.CamlQuery.createAllFoldersQuery(); | |
var discussionItems = list.getItems(qry); | |
context.load(discussionItems); | |
context.executeQueryAsync( | |
function() { | |
OnItemsLoaded(discussionItems); | |
}, | |
OnError | |
); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment