Skip to content

Instantly share code, notes, and snippets.

@vman
Created January 25, 2012 14:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save vman/1676474 to your computer and use it in GitHub Desktop.
Save vman/1676474 to your computer and use it in GitHub Desktop.
getitemscoffee
GetItems = () ->
context = new SP.ClientContext.get_current()
list = context.get_web().get_lists().getByTitle "CoffeeList"
listItems = list.getItems ''
context.load listItems
context.executeQueryAsync ->
#Success CallBack
itemEnum = listItems.getEnumerator()
alert itemEnum.get_current().get_item "Title" while itemEnum.moveNext()
,(sender,args)->
#Failure CallBack
alert "Failed. #{args.get_message()} \n #{args.get_stackTrace()}"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment