Dragging columns using grouped columns

Posted by: moritz.neugebauer on 22 June 2020, 7:54 pm EST

  • Posted 22 June 2020, 7:54 pm EST

    Dear Wijmo team,

    I’m rendering grouped columns, pretty similar to this example:

    https://www.grapecity.com/wijmo/demos/Grid/Columns/ColumnGroups/angular

    Column Level 0

    
    return {
                dataType: Datatype[attribute.datentyp],
                header: this.getAttributHeader(attribute, columnLevel),
                columns: this.calculateSubColumns(attribute),
                binding: 'attributeValue.' + attribute.id + '.content',
                visible: visible,
                format: format,
                isReadOnly: attribute.isReadOnly,
                isRequired: false,
              }
    
    

    Subcolumns

    
    return {
          dataType: Datatype[attribute.datentyp],
          header: this.getAttributHeader(attribute, columnLevel),
          binding: bindingName,
          visible: visible,
          format: pattern,
          isReadOnly: attribute.isReadOnly,
          isRequired: false,
        };
    
    

    However, it is now not possible anymore to rearrange the columns by dragging. Is this intended behaviour?

    Also, when the dataset doesn’t have grouped items included, dragging works just fine. In both cases, I don’t manually set allowDragging property.

    I already figgured out that I can manually set the allowDragging property to true for both Column Level 0 and the normal/subcolumns. Dragging now works. It is also possible to drag a column from inside a column group to outside, and vice versa.

    Is it possible to limit the drag “areas”, so that a subcolumn from within a column group can only be dragged within a column group? And columns from outside a column group can’t be dragged into a group. It should still be possible to drag a “normal” column to a “normal” place.

    Best regards

    Moritz

  • Posted 23 June 2020, 4:25 pm EST

    Hello Moritz,

    We are sorry but currently there is no way by which we can limit the dragging of columns in the same group. But, I have asked the developers whether this can be implemented in the future releases. The internal tracking id of the case is 442304.

    I will update you once I will hear from them.

    Regards,

    Ashwin

  • Posted 23 June 2020, 5:03 pm EST

    Dear Ashwin,

    thank you for letting me know.

    Best regards,

    Moritz

  • Posted 2 July 2020, 9:21 pm EST

    Hi Moritz,

    In the latest nightly build of Wijmo, we have added a new property known as parentGroup which will get the parent group of a column. We can use this property along with the draggingColumnOver event to check whether the current column being dragged is in the same group or not. Please refer to the sample link below:

    https://stackblitz.com/edit/angular-sabbww?

    In this sample, you can easily move the child columns in the same group but you will notice that the parent column itself cannot be dragged to other columns or even the other columns (which do not have any child) cannot be dragged after the parent-child column. This is a limitation because in the draggingColumnOver, we check whether the current column’s parent is same as that of the current column being dragged. But, if for the child columns, the parent will never be the same as that of the columns which do not have any parent.

    For example, if you will drag the Curr column to 6M column, the parent of the 6M column will not be same as that of the Curr column. So the event will be canceled. Even if you will move the Curr column to the Perf column, the bounded column will be 6M because Perf column is only for display and the actual columns are its child.

    If you have any doubts regarding this, please feel free to ask.

    PS: Nightly builds have not passed through the QA cycles as all of our release builds do. Therefore, we would not recommend you use it in production.

    ~regards

  • Posted 5 July 2020, 4:40 pm EST

    Dear Ashwin,

    thank you very much for explaining the new feature.

    Is it possible to enable “normal” columns to be dragged behind grouped columns? E.g. Move column “Curr” between column “Perf” and "Allocation?

    Is it possible to enable grouped columns to be dragged as a whole?

    E.g. Move grouped column before column “Name”?

    Best regards

    Moritz

    Is it possible to enable grouped columns to be dragged as a whole?

  • Posted 6 July 2020, 3:18 pm EST

    Hi Moritz,

    I am sorry but this cannot be achieved. This is a limitation and I have explained this in the previous response:

    [i]In this sample, you can easily move the child columns in the same group but you will notice that the parent column itself cannot be dragged to other columns or even the other columns (which do not have any child) cannot be dragged after the parent-child column. This is a limitation because in the draggingColumnOver, we check whether the current column’s parent is same as that of the current column being dragged. But, if for the child columns, the parent will never be the same as that of the columns which do not have any parent.

    For example, if you will drag the Curr column to 6M column, the parent of the 6M column will not be same as that of the Curr column. So the event will be canceled. Even if you will move the Curr column to the Perf column, the bounded column will be 6M because Perf column is only for display and the actual columns are its child.[/i]

    ~regards

Need extra support?

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

Learn More

Forum Channels