Our pure JavaScript Scheduler component


Post by tomerPlanit »

Hey there.
We're working with Bryntum Scheduler on an Angular 8 project.

1.How can i get all selected rows?

2. I am trying to create multi resource selection feature. I use the selectionMode for this but I have a problem when I multi select the resources the rows is real select but the cells not(only the last clicked resource cell selected).
My implementation:
the configuration:
initConfig() {
        this.schedulerConfig = {
        selectionMode: {
                row: true,
                cell: true,
                multiSelect: true,
                rowCheckboxSelection: false,
                checkbox: false,
                showCheckAll: false
            }
        };

 <bry-scheduler
        [useInitialAnimation]="schedulerConfig.useInitialAnimation">
 </bry-scheduler>
My Resource click function:
// This function take care of all resource clicks.
  resourceClick(
    event: {
      grid: Scheduler;
      record: GanttResource;
      column: ResourceInfoColumn,
      cellSelector: object,
      cellElement: HTMLElement,
      target: HTMLElement,
      event: MouseEvent,
      source: Scheduler,
      type: string
    }) {


    this.storeService.getResourcesPromise().then((resources: IResourceDTO[]) => {
      // Save the resource's data in resourceMenuService.
      this.lastSelectedResource = resources.find((resource: IResourceDTO) => resource.ei === event.record.get('id'));

      // After click change selecting resource.
      this.ganttService.multiSelectedResource(event.record, this.scheduler.schedulerEngine);

      // Clear the job in jobMenuService and reculculate ToolbarMenu.
      this.lastSelectedJob = null;
      this.jobMenuService.recalculateMenu(this.lastSelectedJob);
    });
  }
multiSelectedResource function:
    // multi selected resource.
    multiSelectedResource(resource: GanttResource, schedulerEngine: Scheduler) {
        schedulerEngine.selectRow({
            record: resource,
            addToSelection: true
        });
    }
What i am doing wrong?
Attachments
single click.png
single click.png (102.35 KiB) Viewed 1354 times
multi.png
multi.png (97.51 KiB) Viewed 1354 times

Post by saki »

Re #1:
schedulerEngine.selectedRecords
contains the array you want.

Re #2: It's not clear to me what is the problem here. Part of it can be that you set both row and cell selection config true. Also, we do not (yet) support multi-cell selections so you can get that one selected cell with:
schedulerEngine.selectedCell

Post by tomerPlanit »

Thanks the first part is work.

In the second part I want to achieve the situation when user multi select the rows i want to select the row's cells.

There is a way to implement this?

Post by saki »

Currently you can select multiple rows and/or a single cell. I've created a feature request to support spreadsheet-like cell selections.

https://github.com/bryntum/support/issues/497

Post by tomerPlanit »

Thanks for the quick reply.

Post Reply