Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Day view Scheduler and Drag to create combined demo #1496

Open
roboter opened this issue Aug 4, 2021 · 3 comments
Open

Day view Scheduler and Drag to create combined demo #1496

roboter opened this issue Aug 4, 2021 · 3 comments

Comments

@roboter
Copy link

roboter commented Aug 4, 2021

Is your feature request related to a problem? Please describe

A Day view with Drag to create.

I tried to combine Day view Scheduler and Drag to create
but in drag to create day position is calculated using with and height of a DIV

Describe the solution you'd like
API to get current Column ID in mouse drag

  (mousedown)="customMouseDown.emit({segment:segment, event: $event, user:user})"

user - undefined now

get a row Id or User object

Describe your use case for implementing this feature

Or some other way to get current ROW or User

Additional context

@matts-bot
Copy link

matts-bot bot commented Aug 4, 2021

Thanks so much for opening an issue! If you'd like me to give priority to answering your issue or would just like to support this project, then please consider sponsoring me

@abdulrahman5020
Copy link

@roboter Hey if you find a solution kindly share it

@roboter
Copy link
Author

roboter commented Oct 20, 2021

Very hacky solution: I added data-attributes, and indexes and based on that I can get user ID

<div class="cal-week-view" role="grid">
  <div class="cal-day-headers" role="row">
    <div class="cal-header" *ngFor="let user of users; trackBy: trackByUserId; index as i;" [attr.data-index]="i" [attr.data-masterId]="user.id" tabindex="0" role="columnheader">
      <b>{{ user.name }}</b>
    </div>
  </div>
<div class="cal-day-column" data-id="{{column}}" *ngFor="let column of view.hourColumns; trackBy: trackByHourColumn; index as i;" [attr.data-index]="i" >
 (mousedown)="startDragToCreate(segment, $event, {hour, trackByHour, column, hour, user, i })"
  
   startDragToCreate(segment, $event, segmentElement) {
    const header = document.querySelectorAll('.cal-header');
    this.customEvent.emit({
      date: segment.date,
      masterId: header[segmentElement.i].getAttribute('data-masterId'),
      segmentElement,
      y: $event.y
    });
  }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants