Spread Home action doesn't expand

Posted by: gagandeep.singh on 8 June 2023, 9:46 am EST

  • 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);

  • Posted 9 June 2023, 8:35 am EST

    HI,

    I tried replicating your code snippet and it is fine for me. Could you refer to the following sample and if the issue persists? Please share a working sample that replicates the issue so that we could investigate it further and help you accordingly.

    sample: https://jscodemine.grapecity.com/share/iVGrRAt6UkGAFo8f-Cu3gw/?IsEmbed=false&Theme=Unset&PreviewDirection=0&IsEditorShow=true&IsExplorerShow=true&IsPreviewShow=true&IsConsoleShow=true&IsRunBTNShow=false&IsResetBTNShow=false&IsOpenInCodemineBTNShow=false&PanelWidth=20&PanelWidth=50&PanelWidth=30&defaultOpen={"OpenedFileName"%3A["%2Findex.html"%2C"%2Fsrc%2Fapp.js"%2C"%2Fpackage.json"]%2C"ActiveFile"%3A"%2Fsrc%2Fapp.js"}

    Regards,

    Avinash

Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels