Premium support for our pure JavaScript UI components


Post by ofirk »

Hi,
I have a use case in which i need to create a week grid and be able to assign tasks (shifts) to each resource for each day of the week by drag & drop.
Here's an example of what im talking about:

shiftsScheduleMock.jpg
shiftsScheduleMock.jpg (56.48 KiB) Viewed 143 times

as shown in the image, i would also have an option to drop a task on a resource and it will automatically be assiged to that resource for each day of the week.
the same with dropping a task on a specific Day, will assign the task to all resources in that day.

I dont care for the actual dates, only for the day of the assignment.

is this something I can achieve with the Scheduler?

if so, how would my startDate/endDate/headers config look like?


Post by tasnim »

Hi,
Sure, you can get inspiration from this demo for example https://bryntum.com/examples/scheduler/dragfromgrid/ You would have to solve most of it in your app though, like detecting when you have dropped on a resource or on a time axis tick. But it should be doable


Post by saki »

Yes, it is possible, however a fair amount of user coding will be needed. As to drag&drop, probably the best example to begin with is https://www.bryntum.com/examples/scheduler/frameworks/react/javascript/drag-from-grid/build/ You will probably need your own drop code that would assign the task according to your requirements.

I'm not sure what you mean by

startDate/endDate/headers

would you please explain?


Post by ofirk »

Hi,
Sure, you can get inspiration from this demo for example https://bryntum.com/examples/scheduler/dragfromgrid/ You would have to solve most of it in your app though, like detecting when you have dropped on a resource or on a time axis tick. But it should be doable

Thanks, so the timeAxis / resource dont have a drop event handlers? bummer.

I'm not sure what you mean by

startDate/endDate/headers

would you please explain?

Thanks, I'm talking about the config provided to the scheduler component,
You need to provide a startDate/endDate for the time axis to show.
but in my use case its static (it will always be sunday to saturday)


Post by saki »

startDate and endDate are expected to be Date or a string representation of Date so you would need to calculate the exact date of next (current?) Sunday and Saturday. That's very easy with the help of https://bryntum.com/docs/scheduler/api/Core/helper/DateHelper


Post Reply