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