I'm looking for a way to hide a button from the ribbon using javascript, but to do this I need to wait until the elements of the ribbon are loaded.
Is there a way to detect such event?
I'm looking for a way to hide a button from the ribbon using javascript, but to do this I need to wait until the elements of the ribbon are loaded.
Is there a way to detect such event?
Here is some js that should load efter the ribbon is loaded:
SP.SOD.executeOrDelayUntilScriptLoaded(function() { // Your code here }, "sp.ribbon.js"); More about modifying in this blogpost
Edit:
// Fires ‘ribbontabselected’ after the ribbon has been initialized after load ExecuteOrDelayUntilScriptLoaded(function () { var pm = SP.Ribbon.PageManager.get_instance(); pm.add_ribbonInited(function () { // Your code here }); }, ‘sp.ribbon.js’); from here