selectedData

The selectedData() method returns an object representing the underlying data object of the selected context menu item.


<div id="contextmenu1"></div>

<script type="text/javascript">

    $(function () {
         $("#contextmenu1").shieldContextMenu({
            target: "body",
            dataSource: {
                 data: [
                    {
                        content: "Open"
                    },
                    {
                        content: "Save"
                    }
                 ]
               }
           });
           
           var menu = $("#contextmenu1").swidget();

           //select second item
           menu.selected(true, 1);

           //{ content: "Save" } is returned
           var data = menu.selectedData();
     });

</script>