How to style a Particular RangeGroup Level Number

Posted by: seshareddy.kamaganiguntla on 19 September 2022, 2:59 pm EST

  • Posted 19 September 2022, 2:59 pm EST - Updated 29 September 2022, 5:00 am EST

    Hii, Is there a way to style a particular RangeGroupLevel number , if user selects that level.

  • Posted 21 September 2022, 10:09 pm EST

    Hi,

    We are working on this case. We shall provide you with a response soon.

    Regards, Avinash

  • Posted 22 September 2022, 8:37 pm EST

    The feature(style a RangeGroupLevel number) that you want to implement is not supported by spreadjs. We are sorry for the inconvenience. Here are some customizations that you could perform with outlines:

    As a workaround. you may highlight the cells of a particular group when any cell of that group is selected/active. You can find the active cell with EnterCell event. To get the level of a group, you can use worksheet.rowOutlines.getLevel(index) and you can use worksheet.rowOutlines.find(index, level) to get the start index and end index of a row outline/group. This method an object of OutlineInfo class. Please refer to the following code snippet and attached sample that explains the same.

    
           spread.bind(GC.Spread.Sheets.Events.EnterCell, (event, args) => {
                    let level = activeSheet.rowOutlines.getLevel(args.row);
                    if (level > -1 && args.col < 3) {
                        if (range) {
                            range.backColor(undefined);
                        }
                        spread.suspendPaint();
                        let outlineInfo = activeSheet.rowOutlines.find(args.row, level);
                        range = activeSheet.getRange(outlineInfo.start, 0, outlineInfo.end - outlineInfo.start + 1, 3);
                        range.backColor('#cbeff6');
                        spread.resumePaint();
                    }
                });
    
    

    Doc References

    worksheet.rowOutlines: GC.Spread.Sheets.Worksheet | JavaScript Spreadsheet | SpreadJS

    worksheet.rowOutlines.getLevel(): GC.Spread.Sheets.Worksheet | JavaScript Spreadsheet | SpreadJS

    worksheet.rowOutlines.find(): GC.Spread.Sheets.Outlines.Outline | JavaScript Spreadsheet | SpreadJS

    OutlineInfo: https://www.grapecity.com/spreadjs/api/classes/GC.Spread.Sheets.Outlines.OutlineInfo

    EnterCell Event: https://www.grapecity.com/spreadjs/api/classes/GC.Spread.Sheets.Events#entercell

    index (3).zip

Need extra support?

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

Learn More

Forum Channels