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

Function editors

codebase/sources/dhtmlxscheduler.es.js:10423–10571  ·  view source on GitHub ↗
(scheduler2)

Source from the content-addressed store, hash-verified

10421 notImplemented.alert("Drag Between", scheduler2.assert);
10422}
10423function editors(scheduler2) {
10424 scheduler2.form_blocks["combo"] = { render: function(sns) {
10425 if (!sns.cached_options)
10426 sns.cached_options = {};
10427 const sectionHeight = sns.height ? `style='height:${sns.height}px;'` : "";
10428 var res = "";
10429 res += `<div class='${sns.type}' ${sectionHeight}></div>`;
10430 return res;
10431 }, set_value: function(node, value, ev, config) {
10432 (function() {
10433 resetCombo();
10434 var id = scheduler2.attachEvent("onAfterLightbox", function() {
10435 resetCombo();
10436 scheduler2.detachEvent(id);
10437 });
10438 function resetCombo() {
10439 if (node._combo && node._combo.DOMParent) {
10440 var combo2 = node._combo;
10441 if (combo2.unload) {
10442 combo2.unload();
10443 } else if (combo2.destructor) {
10444 combo2.destructor();
10445 }
10446 combo2.DOMParent = combo2.DOMelem = null;
10447 }
10448 }
10449 })();
10450 window.dhx_globalImgPath = config.image_path || "/";
10451 node._combo = new dhtmlXCombo(node, config.name, node.offsetWidth - 8);
10452 if (config.onchange)
10453 node._combo.attachEvent("onChange", config.onchange);
10454 if (config.options_height)
10455 node._combo.setOptionHeight(config.options_height);
10456 var combo = node._combo;
10457 combo.enableFilteringMode(config.filtering, config.script_path || null, !!config.cache);
10458 if (!config.script_path) {
10459 var all_options = [];
10460 for (var i = 0; i < config.options.length; i++) {
10461 var option = config.options[i];
10462 var single_option = [option.key, option.label, option.css];
10463 all_options.push(single_option);
10464 }
10465 combo.addOption(all_options);
10466 if (ev[config.map_to]) {
10467 var index = combo.getIndexByValue(ev[config.map_to]);
10468 combo.selectOption(index);
10469 }
10470 } else {
10471 var selected_id = ev[config.map_to];
10472 if (selected_id) {
10473 if (config.cached_options[selected_id]) {
10474 combo.addOption(selected_id, config.cached_options[selected_id]);
10475 combo.disable(1);
10476 combo.selectOption(0);
10477 combo.disable(0);
10478 } else {
10479 scheduler2.ajax.get(config.script_path + "?id=" + selected_id + "&uid=" + scheduler2.uid(), function(result) {
10480 var responseText = result.xmlDoc.responseText;

Callers

nothing calls this directly

Calls 6

resetComboFunction · 0.70
attachEventMethod · 0.65
detachEventMethod · 0.65
uidMethod · 0.65
parseMethod · 0.65
eventMethod · 0.65

Tested by

no test coverage detected