- SilverlightCSOM.zip
- SilverlightCSOM
- WPFClient.zip
- WPFClient
- ConsoleDemo.zip
- ConsoleDemo
- SPDemo.zip
- SPUGDemo
- bin
- Debug
- Microsoft.Sharepoint.Sandbox.dll
- SPUGDemo.dll
- SPUGDemo.pdb
- SPUGDemo.wsp
- Release
- Features
- Create List
- Silverlight
- SPUG Demo
- key.snk
- Layouts
- obj
- Debug
- Package
- pkg
- Debug
- SPUGDemo
- Layouts
- manifest.xml
- SPUGDemo.dll
- SPUGDemo_Silverlight
- SPUGDemo_SPUG Demo
- pkgobj
- Debug
- Properties
- Silverlight
- SPUGDemo.csproj
- SPUGDemo.csproj.user
- SPUGDemo.gpState
- SPUGDemo.sln
- SPUGDemo.sln.docstates.suo
- SPUGDemo.suo
|
var LIST_NAME = 'SPUG Demo Contacts';
$(document).ready(function ()
{
});
/// Add Contact button event handler
function onAdd()
{
var ctx = SP.ClientContext.get_current();
var web = ctx.get_web();
var list = web.get_lists().getByTitle(LIST_NAME);
// can be null when adding item to root folder
var createInfo = null;
//var createInfo = new SP.ListItemCreationInformation();
var item = list.addItem(createInfo);
$(".field").each(function ()
{
var id = $(this).attr("ID");
var value = $(this).val();
item.set_item(id, value);
});
item.update();
ctx.executeQueryAsync(
Function.createDelegate(this, onAddContactSuccess),
Function.createDelegate(this, onFail));
}
/// Cancel button event handler
function onCancel()
{
SP.UI.ModalDialog.commonModalDialogClose(SP.UI.DialogResult.cancel, 'Cancel');
}
/// Function to be called after executeQueryAsync
/// in onAdd has been successful
function onAddContactSuccess(sender, args)
{
SP.UI.ModalDialog.commonModalDialogClose(SP.UI.DialogResult.OK, 'OK');
}
/// Function to notify of any failure for executeQueryAsync
function onFail(sender, args)
{
alert(args.get_message());
}
|
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.