Created
January 25, 2012 14:16
-
-
Save vman/1676450 to your computer and use it in GitHub Desktop.
additemcoffee
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
AddItem = () -> | |
context = new SP.ClientContext.get_current() | |
list = context.get_web().get_lists().getByTitle "CoffeeList" | |
listItemCreateInfo = new SP.ListItemCreationInformation | |
listItem = list.addItem listItemCreateInfo | |
listItem.set_item "Title","Mocha" | |
listItem.update(); | |
context.executeQueryAsync -> | |
#Success Callback | |
alert "Item Added" | |
, (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