Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
100
igx-tree-grid drag and drop does not update row expanded indicator or summaries
posted

I have a igx-tree-grid that is bound to a flat array using the primaryKey and foreignKey settings.  I have row summaries turned and set to show even when the row is collapsed as well as drag and drop within the same tree.

When the tree is first displayed everything looks pretty good except in the case where there isn't any children.  In that case neither the expanded indicator or summary is displayed.  Both of these show as I'd expect for the rows that have children.

When I drag and drop between leaves of the tree the row that is moves is displayed within the tree where it should.  But if I drag the item to a row that did not already have children (thus has no expanded indicator) it still doesn't show an expanded indicator one the drop is complete and that row does now have a child.  Along this same line the summary does not show either.

In addition to the above the summary values do not update when the drop is complete.  But once the drop is complete I can manually edit a value in the row that was dropped and that will trigger the summary (if already showing) to recalculate.

Parents
No Data
Reply
  • 2420
    Offline posted

    Hi Nate,

    Thank you for posting to Infragistics Community!

    I have been looking into your question and created this sample on StackBlitz with an IgxTreeGrid displaying flat data and whose parent-child relation is configured using the tree grid's primaryKey and foreignKey properties. Summaries are enabled for the “Age” column and row reordering is implemented to mimic your scenario. The latter is achieved by following the approaches from our documentation, with the added ability to place a signle row as a child of a leaf row by dragging it over.

    On my side, the expansion indicators are rendered correctly with the child row addition, and summaries are also updated accordingly. Please, check out the below gif:

     

    However, as row reordering is an application-level scenario and the logic that achieves this and modifies the underlying data has to be implemented on application level, it is highly possible that your own solution differs and may cause eventual issues.

    Having this in mind, I am wondering if you have implemented your own logic that achieves this? Are you making sure to update the data source on completing the drag operation? For instance, in the demo, reassigning with the help of the spread operator ensures the data is updated:

     this.localData = [...this.localData];

    I can suggest comparing the discrepancies between the sample’s row reordering and data updating logic and your own one, which may point you to the root cause of the issue on your side. As mentioned, this is most likely not an issue with the tree grid itself, but a matter of application level logic.

    If you are not able to identify the potential differences and in order to be able to further assist you, it will be helpful if you could fork and modify the sample with any relevant code that will lead to reliably reproducing the reported behavior and send it back to me along with steps to reproduce.

    Best regards,
    Bozhidara Pachilova
    Associate Software Developer

Children
No Data