Pubblicato da: madamo | giugno 30, 2011

Do you know how to retrieve selected listitems with SharePoint 2010 Client Object Model?

You are creating a Custom Action, that does something in a SP modal dialog and you want to read whitch list items have been selected by the User then you must use this method:

SP.ListOperation.Selection.getSelectedItems

See the following example:
var clientContext = new SP.ClientContext.get_current();
var myWeb = clientContext.get_web()
clientContext.load(myWeb);
var selecteditems = SP.ListOperation.Selection.getSelectedItems(clientContext);
var item;
for (item in selectedItems)
{
//Whatever you want!
}

Bye


Lascia un Commento

Please log in using one of these methods to post your comment:

Logo WordPress.com

You are commenting using your WordPress.com account. Log Out / Modifica )

Foto Twitter

You are commenting using your Twitter account. Log Out / Modifica )

Foto di Facebook

You are commenting using your Facebook account. Log Out / Modifica )

Connecting to %s

Categorie

Follow

Get every new post delivered to your Inbox.