deletedRow event not triggered after deletingRow

Posted by: handerson on 24 April 2020, 5:06 pm EST

    • Post Options:
    • Link

    Posted 24 April 2020, 5:06 pm EST

    Hi,

    I’m trying to have the deletedRow event triggered after deleting a row, but that doesn’t happen and I really don’t know why.

    Wijmo Version: 5.20201.663

    
    let wijgrid = new wijmo.grid.FlexGrid('#grid', {
        autoGenerateColumns: false,
        allowDelete: true,
        keyActionTab: "Cycle",
        keyActionEnter: "None",
        selectionMode: "Row",
        autoSizeMode: 'Headers',
        showErrors: true,
        virtualizationThreshold: 100,
        columns: [
            <bindings>
        ],
        itemsSource: cv,
        deletingRow: (s, e) => {
            console.info('func: deletingRow');
            console.debug('content:', s, e);
            e.cancel = true;
            bootbox.confirm("Do you want to delete this row?", function (result) {
                if (result) {
                    $.ajax({
                        type: "post",
                        url: grid.dataset.urlMarkRow,
                        dataType: "json",
                        data: { row: JSON.stringify(cv.currentItem) }
                    });
                    cv.remove(cv.currentItem);
                } else {
                    e.cancel = true;
                }
            });
        },
        deletedRow: (s, e) => {
            console.info('func: deletedRow');
            console.debug('content:', s, e);
        },
    	<...>
    }
    
    

    Any hint is highly appreciated.

    Best regards

    Helge

  • Posted 27 April 2020, 2:47 am EST

    Hi,

    Since you are setting e.cancel property to true, this will cancel the deletingRow event and will stop the propagation of the event. So, you will manually need to raise the deletedRow event by calling the onDeletedRow method. Refer to the updated sample below:

    https://stackblitz.com/edit/js-neq9mr

    Regards,

    Ashwin

Need extra support?

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

Learn More

Forum Channels