Wijmo Grid - Partially Row deletion

Posted by: chhavi.sethi on 8 October 2020, 1:21 pm EST

    • Post Options:
    • Link

    Posted 8 October 2020, 1:21 pm EST

    Hi,

    I have been struggling with an issue with deleting a row on the grid.

    When a row is about to be deleted either through delete button or something else, at that point I want to decide with putting a business logic whether that row can be deleted or not which I am doing with the following code.

    
    this.grid.value.deletedRow.addHandler((flex: WjFlexGrid, event: CellRangeEventArgs) => {
    			event.cancel = true;
    		});
    
    

    But the only issue happening with this code is, that it does not delete the row(which is fine) but it does delete the data in the cells of that row.

  • Posted 9 October 2020, 1:36 am EST

    Hi Chhavi,

    You will need to use the deletingRow event of FlexGrid instead of the deletedRow.

    https://stackblitz.com/edit/angular-rngpcq

    In this sample, select a row by clicking on its header and press the delete key to delete the row. Rows with even id cannot be deleted in this sample.

    Regards,

    Ashwin

  • Posted 9 October 2020, 12:25 pm EST

    Thanks, Aswin,

    It was my bad, I was using the wrong event.

Need extra support?

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

Learn More

Forum Channels