search envelope-o feed check
Home Unanswered Active Tags New Question
user comment-o

How do i delete a full row?

Asked by peuportier.aurelien@icloud.com
1 month ago.

Dear DayPilot Team,

I trust this message finds you well.

I am interested in understanding the process for deleting a row and all its associated events by implementing a button for each row displayed on the scheduler. The button would function similarly button using by this code below .

Thank you.

rowHeaderHideIconEnabled: true,
Answer posted by Dan Letecky [DayPilot]
29 days ago.

You can add a delete icon to the Scheduler row headers using an active area.

onBeforeRowHeaderRender: (args) => {
    args.row.areas = [
        {
            right: 3,
            top: 3,
            width: 16,
            height: 16,
            symbol: "../icons/daypilot.svg#x-4",  // or another icon
            onClick: (args) => {
                dp.rows.remove(args.source);
            }
        }
    ];
},

If rowHeaderColumns are defined, you can add the icon to a specific column:

onBeforeRowHeaderRender: (args) => {
    args.row.columns[0].areas = [
        {
            right: 3,
            top: 3,
            width: 16,
            height: 16,
            symbol: "../icons/daypilot.svg#x-4",
            onClick: (args) => {
                dp.rows.remove(args.source);
            }
        }
    ];
},
This question is more than 1 months old and has been closed. Please create a new question if you have anything to add.