Ribbon Bar - can it be hidden or disabled entirely

Is it possible to either hide the ribbon bar or disable it completely.

This is so that the user cannot click on any controls at all under certain circumstances.

Thanks

Unfortunately there is no such possibility.

Hi Everyone
This turned out to be quite easy to do so I have shared a snippet here for anyone else that may want to do it.

What it does is that

  • when you call setMainRibbon(false) it records the status of all of the controls on the ribbon
    and then disables them. Note it does not touch blocks or groups or text items.
  • when you call setMainRibbon(true) it restores the items to their previous state.

note: dontTouch is a list of items that you never want disabled.

I hope this helps someone.

var ribbonStates = new Array();
var ribbonDisplayed = true;

// Enables or disables all buttons on the mainRibbon bar.
function setMainRibbon(enable) {
            var dontTouch =  ['item1','item5','item13'];
	if(enable){
		if(mainRibbon != null && !ribbonDisplayed){
			ribbonDisplayed = true;
			ribbonStates.forEach(function(item){
				var control = mainRibbon._items[item.id];
				if(item.disable == true)
					mainRibbon.disable(item.id);
				else
					mainRibbon.enable(item.id);
			});
		}
	}else{
		if(mainRibbon != null && ribbonDisplayed){
			ribbonDisplayed = false;
			ribbonStates = [];
			var keys = Object.keys(mainRibbon._items);
			keys.forEach(function(id){
				var item = mainRibbon._items[id];
				if(item.type != undefined && item.type != "group" && item.type != "block" && item.type != "text"){
					if(!dontTouch.includes(id) ){
						ribbonStates.push ({
							id: item.id,
							disable: item.conf.disable
						});
						mainRibbon.disable(id);
					}
				}
			});	
		}
	}
};