Hi All,
I have created a custom visual webpart in SP 2010 with following code. "SP.ListOperation.Selection.getSelectedItems" is not returning the selected items
<script type="text/javascript"> function ShowSelectedItems() { var ctx = SP.ClientContext.get_current(); var selectedItems = SP.ListOperation.Selection.getSelectedItems(ctx); var key; for (key in selectedItems) { alert(selectedItems[key].id); } }</script> <SharePoint:ListView ID="caseView" runat="server" ListId="fc368824-cf03-49cf-a545-bf7a3dde8326" ViewId="34b4c31f-a3bb-4f1b-9834-4c3419bfed1b" /> <input name="btnShowSelectedItems" id="btnShowSelectedItems" onclick="ShowSelectedItems();" type="button" value="Show Selected Items"/>