Search code examples
tabulator

how to multiple delete rows with selectableRange : true,..?


i am using tabulator version 6.2 javascript,, when using selectableRows: true, multiple delete rows is working, but when using selectableRange: true, it doesnt,, how to do it? i am use selectableRange because clipboard feature, in selectableRows clipboard feature can't be use

i use tabulator as interactive table and can be crud on table, i try to make multi delete feature when i use selectableRow: true, its work as well, but when i use selectableRange: true, its only remove one row that where i am right click on that, i make a custom contextmenu with, rowContext


Solution

  • Using

    this.table.getRanges().map(range => range.getRows().map(row => row.getPosition()))
    

    Later, you get the position,

    let row = this.table.getRowFromPosition(position); // Get the row using the position 
    this.table.deleteRow(row); // Delete the row