Which code segment should you use?

You create a modal dialog that displays a list of items.

You need to capture the items selected by a user.

Which code segment should you use?

You create a modal dialog that displays a list of items.

You need to capture the items selected by a user.

Which code segment should you use?

A.
SPItem item = SPContext.Current.Item;

B.
var items = SP.ListOperation.Current.Item();

C.
var items = SP.ListOperation.Selection.getSelectedItems();

D.
var item = SPContext.Current.Item[“Selected”];

Explanation:
MNEMONIC RULE: “getSelectedItems”

SP.ListOperation.Selection.getSelectedItems() Method
http://msdn.microsoft.com/en-us/library/ff409526.aspx



Leave a Reply 0

Your email address will not be published. Required fields are marked *