Posted 8 June 2023, 9:46 am EST - Updated 8 June 2023, 9:52 am EST
In my code I removed some actions from Home actions like in the following code but home actions become like this in screenshot, so it doesn’t look good. How can I make them expandable every time?
var homeMenu = config.ribbon.find(x => x.id == 'home');
var homeMenuIndex = homeMenu.buttonGroups.length;
while (homeMenuIndex--) {
if (homeMenu.buttonGroups[homeMenuIndex].label == 'Styles' || homeMenu.buttonGroups[homeMenuIndex].label == 'Cells'
|| homeMenu.buttonGroups[homeMenuIndex].label == 'Undo'
|| homeMenu.buttonGroups[homeMenuIndex].label == 'Clipboard') {
homeMenu.buttonGroups.splice(homeMenuIndex, 1);
}
}
homeMenu.buttonGroups.forEach(function (item, index) {
if (item.label === 'Numbers' && item.commandGroup.children.length > 1) {
item.commandGroup.children.splice(0, 1);
}
if (item.label === 'Editing' && item.commandGroup.children.length > 1) {
item.commandGroup.children.splice(0, 2);
item.commandGroup.children[0].children.splice(1, 3);
}
if (item.label === 'Alignment' && item.commandGroup.children.length === 3) {
item.commandGroup.children.splice(1, 2);
if (item.commandGroup.children[0].children.length === 2 && item.commandGroup.children[0].children[0].children.length === 5) {
item.commandGroup.children[0].children[0].children.splice(3, 2);
}
}
delete item.indicator;
});
var index = config.ribbon.length;
while (index--) {
config.ribbon.splice(index, 1);
}
config.ribbon.push(homeMenu);
var designer = new GC.Spread.Sheets.Designer.Designer(document.getElementById('DesignerHost_' + self.uniqueFormNameID), config, spread);

