FlexGrid FlexTree cancel child edited row does not work?

Posted by: admin on 20 July 2022, 5:00 am EST

  • Posted 20 July 2022, 5:00 am EST

    Hi!

    we've looked around the forum and found nothing on my particular issue:

    We have to edit a treeGrid either parent node or child node. Each row can be cancelled while editing and other CRUD stuff while not.
    Recently we found out that child rows do not behave like parent's one when in edit, using CollectionView.cancelEdit() method inside cancel click button handler...

    We've then forked Grid_TreeGrid_EditableTreeGrid_Angular exemple to add a column with cancel button on edit. And was able to reproduce the issue: the click on the "button cell" triggers cellEditEnding event, and others before even reaching to cancel button click handler.

    Is there a way of handling the cancel as of on parent row?
    Btw the cancel by escape key works fine, unfortunally this app is aimed to go on mobile devices, hence no escape key...

    here is the modified jsCodemine of the treeGrid edit sample :

    https://jscodemine.grapecity.com/sample/bGK057iFN0qJXx0itDBsSg/
  • Replied 20 July 2022, 10:14 pm EST

    Hi,
    The reason for the observed behavior is that the cell edit is complete before the button clicked so the changes are committed to the cell.
    To avoid this, we need to handle the mousedown event and cancel the editing by calling the finishEditing() method.

    Please refer to the updated sample:
    https://jscodemine.grapecity.com/share/P784ABQ220GX8f5plXj4bA/

    Regards,
    Manish Gupta
  • Replied 20 July 2022, 11:21 pm EST

    Hi, and thx for the answer.

    manish.gupta said:

    The reason for the observed behavior is that the cell edit is complete before the button clicked so the changes are committed to the cell.


    Why the main parent rows does not commit edit while childs one does? is this expected behavior?

    Sincerely.
  • Replied 3 August 2022, 5:46 am EST

    Hi,
    We are glad to know that your issue has been resolved. The possible reason is that the for children cell update, we need to update the value and it might not be required for the parent rows.

    Please use the provided workaround and it should work for both the parent and child items.

    Regards,
    Manish Gupta
Need extra support?

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

Learn More

Forum Channels