Custom Ajax Select Fields on Details Form

Hi,
I am using the units (multiple resource) extension of the Scheduler and would like to add a custom field onto the details form that will be filtered using the actual resource when new events are added in the units view.

So my questions are:

  1. Is there an easy way to obtain the selected unit identifier when new events are added?
  2. Are Ajax populated fields supported on the Details form?

Would greatly appreciated any guidance as to how to do this!

thank you in advance!

Hello,

Right now there is no easy way to do it. We will consider adding such functionality in the upcoming version. As a temporary solution you can try adding following code at the top of dhtmlxscheduler_units.js file.

scheduler.getUnitSection = function(event_id) { var ev = scheduler.getEvent(event_id); // getting event object var options = scheduler._props['unit'].options; // array with all options used in units view var section; for(var i=0; i<options.length; i++) { // getting section information for specified event id if(ev.section_id == options[i].key) section = options[i]; } return section; };
This method will return object with the section information (key, label).

Yes, this way section could be displayed from the start and populated with values later (from Ajax callback function) but there is no default solution/some kind of helpers to do it.

Sorry, didn’t quite get what you are trying to do. By default lightbox has section which displays the resource for which event will be created.

Best regards,
Ilya