Cancel edit mode with button in Flexgrid - Angular2 - Wijmo5

Posted by: webworx on 9 November 2017, 3:00 am EST

    • Post Options:
    • Link

    Posted 9 November 2017, 3:00 am EST

    Hi, when i enter a cell and want to end the editing and remove the new created row, i can press the escape key on the keyboard.

    What can i do to get the same result with a button or how to simulate the escape key press?

    Or is there any fiddle with inline editing and a custom save/cancel toolbar. I saw a similar example (http://fiddle.jshell.net/MrGrande/h0nap3tw/), but i dont want to render the inputs programatically and to want have the cancel/save just once when i edit a cell.

    Best regards, Asmo

  • Posted 9 November 2017, 11:38 pm EST

    Hi,

    You can use cancelNew method for removing newly added row from FlexGrid while you are in the same row.

    Same cancelEdit is used to prevent commit pending changes.

    These methods are from CollectionView class and can be used to cancel editing/adding inline editing without committing changes.

    ~Manish

  • Posted 17 November 2017, 1:20 am EST

    Hi Manish, thank you.

    its working but only with that configuration. We have also a cell validation in our grid with marks invalidate cells with red border.

    this.grid.finishEditing(true);

    this.collectionViewData.cancelEdit();

    this.grid.invalidate();

    Only setting cancelEdit() is not working. Can you please confirm or explain that.

    ~Asmo

  • Posted 19 November 2017, 11:14 pm EST

    Hi Asmo,

    We are investigating on this.

    ~Manish

  • Posted 20 November 2017, 11:20 pm EST

    Hi Asmo,

    Could you please let us know how you are using validation, CollectionView getError method or itemFormatter?

    Could you please modify original fiddle to demonstrate your problem?

    ~Manish

  • Posted 11 December 2017, 1:19 am EST

    Hi,

    We are looking into this.

    ~Manish

  • Posted 12 December 2017, 8:59 pm EST

    Hi Asmo,

    We tried to configure the code but we were unable. Could you please modify attached sample for investigation.

    Also, we could observe the code snippet by you and only cancelEdit mehtod unable to end cell edit if the previous value of cell is also invalid.

    Hence, this is a valid case to remain cell in edit mode.

    ~Manish

    GridValidation.zip

Need extra support?

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

Learn More

Forum Channels