MCPcopy Create free account
hub / github.com/DHTMLX/scheduler / _initFromConfig

Method _initFromConfig

codebase/sources/dhtmlxscheduler.es.js:9435–9472  ·  view source on GitHub ↗
(scheduler2, initConfig)

Source from the content-addressed store, hash-verified

9433 return scheduler2;
9434 }
9435 _initFromConfig(scheduler2, initConfig) {
9436 if (initConfig.plugins) {
9437 scheduler2.plugins(initConfig.plugins);
9438 }
9439 if (initConfig.config) {
9440 scheduler2.mixin(scheduler2.config, initConfig.config, true);
9441 }
9442 if (initConfig.templates) {
9443 scheduler2.attachEvent("onTemplatesReady", function() {
9444 scheduler2.mixin(scheduler2.templates, initConfig.templates, true);
9445 }, { once: true });
9446 }
9447 if (initConfig.events) {
9448 for (const event2 in initConfig.events) {
9449 scheduler2.attachEvent(event2, initConfig.events[event2]);
9450 }
9451 }
9452 if (initConfig.locale) {
9453 scheduler2.i18n.setLocale(initConfig.locale);
9454 }
9455 if (Array.isArray(initConfig.calendars)) {
9456 initConfig.calendars.forEach(function(calendar) {
9457 scheduler2.addCalendar(calendar);
9458 });
9459 }
9460 if (initConfig.container) {
9461 scheduler2.init(initConfig.container);
9462 } else {
9463 scheduler2.init();
9464 }
9465 if (initConfig.data) {
9466 if (typeof initConfig.data === "string") {
9467 scheduler2.load(initConfig.data);
9468 } else {
9469 scheduler2.parse(initConfig.data);
9470 }
9471 }
9472 }
9473}
9474function active_links(scheduler2) {
9475 scheduler2.config.active_link_view = "day";

Callers 1

getSchedulerInstanceMethod · 0.95

Calls 6

pluginsMethod · 0.65
mixinMethod · 0.65
attachEventMethod · 0.65
initMethod · 0.65
loadMethod · 0.65
parseMethod · 0.65

Tested by

no test coverage detected