Search code examples
javascripteventssharepoint-2010web-parts

Catch a restore event when Sharepoint 2010 webpart is in minimize mode


I have a SharePoint 2010 web part in minimize mode, what I want is when I click on restore in the menu of the minimize menu options , I should be able to capture that event.

enter image description here

How can I get an event when this restore option is selected?


Solution

  • I found a solution for what I was looking for, while doing it I found few things about SharePoint, I am not sure if they apply everywhere but I found them interesting enough to share,

    1. Click events cannot be attached to verbs in menu items.
    2. There were times when I found that I can select elements by using pure JavaScript rather than using Jquery [I am still confused why this happens].

    Well solution turned up to be pretty simple for the question, I used a mouseup instead of click and i could capture it,

    $('#MSOMenu_Restore').live('mouseup',function(){alert('trexx')});
    

    Thanks ,

    Rahul