selectedData

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


<div id="menu1"></div>

<script type="text/javascript">

    $(function () {
         $("#menu1").shieldMenu({
            dataSource: {
                 data: [
                    {
                        content: "Item One"
                    },
                    {
                        content: "Item Two"
                    },
                    {
                        content: "Item Three"
                    }
                 ]
               }
           });
           
           var menu = $("#menu1").swidget();

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

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

</script>