Our pure JavaScript Scheduler component


Post by vu cuong »

Hi support,
I've seen your example for the drag from grid to the scheduler but is it possible to do the opposite way, from scheduler to the grid? Please share an example

Thank you


Post by mats »

Everything is possible, just need to study our API to learn how :)

Please first describe your use case and we'll see how to best do it.


Post by vu cuong »

Hi mats,
Thank you for your quick response, it's great to hear that :)
Our use case is the same as in your example (https://www.bryntum.com/examples/scheduler/dragfromgrid/) but instead of drag from grid we would like to drag task back from scheduler to the grid


Post by mats »

First you have to set this to false to allow events to be dragged outside the scheduler: https://bryntum.com/docs/scheduler/#Scheduler/feature/EventDrag#config-constrainDragToTimeline

Then need to listen to the drop event and process the action to remove the event record from Scheduler's event store, something like this. Should be doable!

If you need our help, we offer professional services too: https://www.bryntum.com/services/


Post by vu cuong »

Dear mats,
Yes I can make it now but is it possible to restrict the drop zone of the event, eg: on a specific style zone like in dropTargetSelector?
Thanks


Post by saki »

You need to assign a css class to the grid and then set this CSS as dropTargetSelector.

If you need a more granular control, then you could implement https://bryntum.com/docs/gantt/#Gantt/feature/TaskDrag#config-validatorFn


Post by vu cuong »

Dear saki,
I'm now using scheduler, not gantt and want to drag from scheduler to grid.
Yes, I've already set css for the grid but where can I put dropTargetSelector for this csss?


Post by saki »

I've put together an example that shows how you can do it. Take it as a model and add your code to fulfill your requirements.

It is a modified drag-from-grid example but implements the opposite direction of D&D.

Attachments
drag-from-grid.zip
(1.06 MiB) Downloaded 82 times

Post by vu cuong »

Dear saki,
Thank you very much for your example, that's what I need

Thanks


Post by vu cuong »

Hi,
I think dropTargetSelector should be made a list of an array where we can define valid drop locations, not just a string where can be restricted to only 1 location


Post Reply