14. Advantages Disadvantages
• Easy to create • If complex, hard to manage
• Easy to manage • Lots of JavaScript can be
• Great for simple commands hard to manage
• Not cached on the client
• Not reusable outside of the
definition
15. Advantages Disadvantages
• External JS library • Poor JavaScript dev tools
• Easier to manage & debug • Must be added to the page
• Can be minified • More work (build, register &
• Allows for greater control initialize on page)
over commands • All OO JavaScript
• Enable/disable command
• Block loss of focus
• Reusable across
customizations
16. Global Commands Focused Command
• Always available when on a • Only available at specific times,
page e.g. when web part has focus
• (if CanExecute says it is • Example: Content Editor Web
available) Part controls
17.
18.
19.
20. SplitButton ToggleButton Spinner
• Easy default plus • Off or on • Select within a
sub-menu range
21.
22.
23.
24.
25.
26.
27.
28.
29. Server side:
SPRibbon.MakeTabAvailable For contextual tab
SPList.UserCustomActions Target an individual list
JavaScript:
RefreshCommandUI() Refresh ribbon, e.g. in async
callback
SP.SOD.ExecuteOr Deal with JS dependencies
DelayUntilScriptLoaded()
Parent control won’t appear.Error “MenuSections can only have children of type MenuItem, Gallery or GroupPopup. - will get error below”No options appearOtherwise no options appear!