I am using DHTMLX Scheduler in an application that requires a custom section with a template type editor. The editor need to have a search text box, a button and a drop down list. How do I instantiate these controls in the event handler? An example with a custom editor section would be greatly helpful.
scheduler.locale.labels.section_greeting = ‘Template’;// sets the section label that will be displayed in the header of the section
…
scheduler.config.lightbox.sections=[
// other sections
{ name: “greeting”, height: 21, map_to: “my_template”, type: “template” }
];
scheduler.attachEvent(“onEventCreated”, function(id, native_event) {
var ev = scheduler.getEvent(id);
ev.my_template = “Hello there!And there too!”; // my_template is the value of the ‘map_to’ property
});
Source: docs.dhtmlx.com/doku.php?id=dhtm … r:template
I have added sample light box image (updated in paint) of what has been accomplished so far and what needs to be accomplished and also database relationship we are trying to link light box to:
Image: A
Database relationship
Image: B
Accomplished so far
Image: C
Need to Accomplish
The customer id field is a foreign key in the Schedule_visit table. We need to be able to search customer and once searched customer is selected, the text box (grey one, left top of light box) should display searched customer name and its value should be bound to customer_id (see image:C in attached image).
Hello,
you can use
scheduler.formSection(controlName).node
to access control’s html once it is rendered. Then you’ll be able to attach custom event handlers to trigger search
Thanks Aliaksandr, I managed to create custom editors and bind them to custom javascript events as well.
Right now I am facing one other issue, i.e. I want to insert ‘null’ values in database for customer_id foreign key, if I leave customer field blank (see reference image from previous post). How do I achieve that. currently SchedulerConnector is being used to perform insert and update.