Can I do that?

Hello all!
I have one idea,but no understand how do this…

I create scheduler with units view. Where units is doctors and loads from database


Then i want create second scheduler where this units will be in Timeline view.
And there i want to set the range of working days for whis doctors.

For Example: I change workdays range for Doctor#1 to 11 may-11june.
Then when i go to scheduler#1 in units will be show only Doctor#1,because for Doctor#2 and #3 range workdays dont’t set.

I mean I need to somehow transfer the date range to the database from the sheduler №2 and then compare and search for the current date from the sheduler №1 in this range… Is that possible?

Thank you advance!

Hello,

it is possible, but I can’t give you simple steps on how to implement it.

Overall, it can look like the following:

  1. You have a scheduler with workers timeline (‘workdays calendar’), which reads/writes events to ‘workdays’ table
  2. And you have another scheduler with appointments(‘appointment calendar’) which reads/writes events to ‘appointments’

The workdays calendar is a simple scheduler and should be pretty straightforward.

As for the appointments calendar.
Firstly, you can load sections into the units view from the server with the data:
docs.dhtmlx.com/scheduler/data_ … ollections
docs.dhtmlx.com/scheduler/units … mtheserver

And you can make scheduler to reload the data each time you switch to the different date
docs.dhtmlx.com/scheduler/api__ … dmode.html
The dynamic loading will cache previously loaded ranges, which you don’t need. You can bypass it by clearing scheduler manually on each date change:

scheduler.setLoadMode("day") scheduler.attachEvent("onBeforeViewChange", function(old_mode,old_date,mode,date){ if(old_mode != mode || old_date+ != date+){ scheduler.clearAll(); } return true; });

After this step, the units view will request a backend each time it’s switched to a different date and will send a displayed date with the request parameters.

Then, on a backend, you’ll be able to select which sections (doctors) you want to display for a requested date - those who have records in workdays table in the requested days, e.g. list of doctors -> select workerId, workerName from workday where start_date < dateTo and end_date > dateFrom.

And this should be pretty much it.

I can find you a demo with loading sections for timeline/units for different dates, although I only have asp.net mvc demo at ready.