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

Selecting Multiple Rows Header On Row Click

Asked by Taslim khan
17 days ago.

I want to select multiple resources in the onRowClicked function, but I'm having trouble doing so. While I can use Ctrl + click to select multiple rows, I would like to be able to select multiple resource rows with just a single click.
using on angular 8 Daypilot pro for javascript 2021

Answer posted by Dan Letecky [DayPilot]
17 days ago.

You can add the row to selection in onRowClicked using the rows.selection.add() method.

It is also possible to implement a “toggle” logic using rows.selection.isSelected() and rows.selection.remove():

onRowClicked: args => {
  const selected = scheduler.rows.selection.isSelected(args.row);
  if (selected) {
    scheduler.rows.selection.remove(args.row);
  } else {
    scheduler.rows.selection.add(args.row);
  }
}
Comment posted by Taslim khan
16 days ago.

 onRowClicked: (args) => {

      const selected = this.scheduler.control.rows.selection.isSelected(args.row);

 

      if (selected) {

          this.scheduler.control.rows.selection.remove(args.row);

      } else {

          this.scheduler.control.rows.selection.add(args.row);

      }

    },

I want to implement a feature that enables users to select n Number rows by clicking and to deselect them by clicking again. However, this functionality isn't working with my current code. Can you suggest a solution?

New Reply
This reply is
Attachments:
or drop files here
Your name (optional):