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
180
Delete using ActionStrip not refreshing table when cancelled
posted

I am trying to use the ActionStrip within a pretty basic grid and have an issue with refreshing the grid.

The annoying one is not being able to intercept and confirm a cancel before the deletion is done.  I am handling that by storing a copy of the grid data, and then once the default actioinstrip delete is done, asking for a confirmation and if the user selects cancel, copying the copied data back into the variable used by the grid.

let confirm = window.confirm("This will delete this Emial Signature, confirm?");
if(confirm) { . . .} else {this.data = this.tempData;}

But the grid is not showing the record, even though the this.data variable is showing the proper data when examined while running.
Is there a way to force the grid to refresh? this.grid.refreshgridState() without arguments and this.grid.reflow() do nothing for me.
Parents
  • 700
    Offline posted

    Hello Ted,

    Thank you for posting into our community!

    I have been looking into your question and an approach I could suggest is using a custom implementation for the row delete action instead of the default one.

    This could be achieved by wrapping a custom button inside the IgxActionStripComponent with the logic for opening the IgxDialogComponent and retrieving the row that should be deleted. Then, if the user confirms that the row should be deleted, you could use the IgxGridComponent’s deleteRow method to delete the corresponding record.

    Here could be found a small sample demonstrating my suggestion.

    Additionally, I believe that you will find our Row Actions topic here quite helpful as it provides detailed information as well as a sample with code snippets demonstrating how custom actions could be implemented inside the IgxActionStripComponent.

    Please test this approach on your side and let me know if you need any further assistance regarding this matter.

    Looking forward to your reply.

    Sincerely,
    Riva Ivanova
    Associate Software Developer

Reply Children