Our pure JavaScript Scheduler component


Post by stan92 »

Hi,
Is it possible to drag and drop an external object into the scheduler using Angular7/8?
I have a list of predefined "appointments" (meetings, vacations, etc) and would like to drag and drop them into the scheduler

Post by Maxim Gorkovsky »

Hello.
That sounds possible. We have a demo for dragdrop between grid and scheduler, showing basic pricinple of such feature:
- There is an entity which is aware of the possible drag source and drag target
- Entity knows what can be dragged and what to do on drop

https://www.bryntum.com/examples/scheduler/dragfromgrid/

Post by stan92 »

Hi Maxim,
I thank you for your reply.. It's exactly what I'm looking for.
By the way, is it possible to keep the orignal "task" onto the grid once it was set onto the scheduler?
(I need to drag and drop several times the same task)

Post by Maxim Gorkovsky »

It is possible, yes. 'Drag' class in the demo specifically removes the task from the origin grid, you can stop that by removing the corresponding line in 'onTaskDrop' method:
me.grid.store.remove(task);
But also in that case you would need to copy the object. We add record instance, you would need to do smth like:
schedule.eventStore.add(Object.assign({}, task.data))
Or use copy method on the model

Post by stan92 »

Thanks.. it really helped.

Post Reply