Our state of the art Gantt chart


Post 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 ?

Attachments
Screenshot.png
Screenshot.png (45.63 KiB) Viewed 51 times

Post 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

Pavel Miklashevich - Core Developer

Post by JSureka »

got it. Thank you


Post Reply