Grouping not applying correctly to rows

Posted by: akshay.bhinge on 28 September 2022, 8:25 am EST

  • Posted 28 September 2022, 8:25 am EST - Updated 3 October 2022, 8:59 am EST

    Hi,

    I’m using rowOutlines to group rows in a sheet. These groups are expected to be nested. However, I’m facing a bug while doing this.

    The bug is reproducible when two groups from two separate levels end at the same row.

    Consider the example in the image:

    Level 2 group starts at 55 and ends at 60. Level 3 group 1 starts at 55 and ends at 57 & Level 3 group 2 starts 58 and ends at 60. When this is the case, Level 3 group 2 is not visible on the sheet, but is present in the rowOutlines JSON.

    When changed the end of Level 3 group 2 or Level 2 group 1, Level 3 group 2 started appearing. Is there a way around it?



    Also attaching the code I use to group the ranges

    sheet.rowOutlines.group(start, groupCount);
    
  • Posted 29 September 2022, 4:45 am EST

    Hi Akshay,

    I tested with the latest version of SpreadJS V15.2.2, and notice that the SpreadJS follows the same policy as Microsoft Excel for the row and column outlines.

    I tested with the hosted SpreadJS Designer: https://www.grapecity.com/spreadjs/designer/index.html

    Could you please share a working sample where you are facing the issue? You could also use the above mentioned link and share a video/gif describing the issue faced by you.

    Outline Demo: https://www.grapecity.com/spreadjs/demos/features/worksheet/outline/customize-group/purejs

    You could also modify the above demo and share the sample code with us. Also, please mention the steps you are following.

    Regards,

    Ankit

  • Posted 29 September 2022, 4:50 am EST - Updated 3 October 2022, 8:59 am EST

  • Posted 30 September 2022, 5:08 am EST - Updated 3 October 2022, 8:59 am EST

    Hi Ankit,

    I tested on the demo provided by you and it’s reproducible there as well.

    The conditions are that the last group in a grouping level > 1 should have it’s end the same as the end of the previous group.

    Sharing the demo link and screenshot of the changes I made.

    https://jscodemine.grapecity.com/sample/FfWVue3NFkG7jwIKe1L00w/

    Regards

  • Posted 30 September 2022, 5:10 am EST - Updated 3 October 2022, 8:59 am EST

    And here’s a screenshot of where it works. It works here because the end row of the last group of level 2 is 1 less than level 1’s group

  • Posted 3 October 2022, 11:59 pm EST

    Hi Akshay,

    This is the expected behavior of SpreadJS. It matches with the behavior of Microsoft Excel.

    Please refer to the following sample: https://jscodemine.grapecity.com/share/SdnJaorAl0WIqzEKZEQoLQ/

    In the sample, observe that for the 2nd level, rowOutline is not applied for the range(15,6) and you will see the dots at the second level. Please refer to the below image:

    Now click the ‘Set Group’ button, it will set the rowOutline for the range (15, 6). It will make the ending range collide with the parent of the outline. Notice that the group bar line doesn’t appear and the dots are shown in the second level. Please refer to the below image:

    This behavior matches with Microsoft Excel. In Microsoft Excel also, if you select the rows from 16 to 21, you will observe that the group bar line doesn’t appear and the dots are shown in the third level(the same behavior is shown by SpreadJS). You will find the excel attached that I have used for testing. Please refer to the following gif that shows the steps:

    SpreadJS follows the Microsoft Excel’s policy. Could you please share a scenario where SpreadJS’s behavior conflicts with that of Microsoft Excel?

    If you want the grouping to extend till the Row no 22, you could use the sheet.rowOutlines.group(15, 7);

    Regards,

    Ankit

    Attached Excel File: GroupingSample.zip

  • Posted 6 October 2022, 12:31 am EST

    Hi Akshay,

    It seems like there is some issue posting images on the forum right now. Please find attached zip file that shows the above-mentioned pics and gif.

    Regards,

    Ankit

    grouping-behavior.zip

Need extra support?

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

Learn More

Forum Channels