Adding new fields


#1

Hallo everyone, is it possible to add new custom fields to create a new event? Could you please show me some the code of an example?
thanks.


#2

Hello @javitineo ,

You can add any additional property to the event data, here is an example of such data:
https://docs.dhtmlx.com/scheduler/data_formats.html#datawithcustomproperties

If you asking how to add controls for custom properties into a lightbox, you should add the additional section for the lightbox.sections config:
https://docs.dhtmlx.com/scheduler/api__scheduler_lightbox_config.html

You can use different controls for such purpose, which is described by the following link:
https://docs.dhtmlx.com/scheduler/lightbox_editors.html

Here is a code example of custom type property and the select control for it:

var alert_opts = [
    { key: 1, label: 'None' },
    { key: 2, label: 'On start date' },
    { key: 3, label: '1 day before' }
];
 
scheduler.locale.labels.section_select = 'Alert';
 
scheduler.config.lightbox.sections = [
    { name:"text", height:50, map_to:"text", type:"textarea", focus:true },
    { name:"select", height:40, map_to:"type", type:"select", options:alert_opts},
    { name:"time", height:72, type:"time", map_to:"auto"}
];

Sample:
https://docs.dhtmlx.com/scheduler/samples/01_initialization_loading/08_options.html

If it’s not the thing you asked about, could you please clarify the question?