0

I want to add custom actions to my save or check-in buttons when a page is in edit mode.

The IDs from the buttons I want to add events:

Ribbon.WikiPageTab.EditAndCheckout.SaveEdit.Menu.SaveEdit.SaveAndStop-Menu16
Ribbon.WikiPageTab.EditAndCheckout.SaveEdit.Menu.SaveEdit.Save-Menu16
Ribbon.WikiPageTab.EditAndCheckout.SaveEdit-SelectedItem
Ribbon.WikiPageTab.EditAndCheckout.Checkout-SelectedItem
Ribbon.WikiPageTab.EditAndCheckout.Checkout.Menu.Checkout.Checkin-Menu16
ctl00_PageStateActionButton

The only button event that gets fired is the ctl00_PageStateActionButton button. All other ribbon buttons are not working.

Tried following code:

$('#id').on("click", function(e){});
$('body').on("click", "#id", function(e){});
$('body').delegate("#id", "click", function(e){});

Also tried the IDs with "\" and without before each "." But nothing worked.

8
  • How are you presently trying to add this?
    – Graham
    Commented Jun 25, 2015 at 15:33
  • With jquery as I posted. But I beleive it is not possible that easy, because Sharepoint is always overwriting my event registration Commented Jun 29, 2015 at 9:19
  • I meant what method are you using to add this jQuery to the site? Where are you adding this? Via Visual Studio/solution, master page, web part on the page or SP Designer?
    – Graham
    Commented Jun 29, 2015 at 15:41
  • Just on the page... Used executeFunc callback after loading sp.js and also tried the add_pageLoaded callback to make sure everything is ready. But it is not working. Commented Jun 30, 2015 at 9:26
  • Are you just putting this in a script editor webpart?
    – Graham
    Commented Jun 30, 2015 at 14:45

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.