Page 1 of 1

[REACT] How to delete multiple row in task editor

Posted: Fri Feb 19, 2021 1:20 pm
by JSureka

Hi,
I want to include multiple row delete option in the task editor popup. I tried adding a separate check box column by using the following code.

              {
                type: "check",
                showCheckAll: true,
                width: "52px",
              },

I have shared the screenshot of the task editor below with the checkbox column highlighted
How to add the delete functionality for selecting multiple rows at a time ?


Re: [REACT] How to delete multiple row in task editor

Posted: Fri Feb 19, 2021 6:43 pm
by pmiklashevich

You can use selectionMode row and checkbox

    selectionMode : {
        row      : true,
        checkbox : true
    },

Then remove selected records from the store.
https://www.bryntum.com/docs/gantt/#Core/data/Store#function-remove
https://www.bryntum.com/docs/gantt/#Grid/view/Grid#property-selectedRecords

You can open our demo, for example columntypes, select multiple rows, and run in console:

grid.store.remove(grid.selectedRecords);

You can add a button to run that code on click.

It is also possible to do it with a check column added manually as you did. By enabling a checkbox you change a boolean data field on the records which is bound to the column. Basically you can query all records with this field true, and pass them to the store.remove function.

Cheers,
Pavel


Re: [REACT] How to delete multiple row in task editor

Posted: Fri Feb 19, 2021 8:40 pm
by JSureka

got it. Thank you