/* dhtmlxScheduler v.4.3.0 Stardard This software is covered by GPL license. You also can obtain Commercial or Enterprise license to use it in non-GPL project - please contact sales@dhtmlx.com. Usage without proper license is prohibited. (c) Dinamenta, UAB. */ scheduler.form_blocks['combo']={ render:function(sns) { if (!sns.cached_options) sns.cached_options = {}; var res = ''; res += "
"; return res; }, set_value:function(node,value,ev,config){ (function(){ resetCombo(); var id = scheduler.attachEvent("onAfterLightbox",function(){ // otherwise destructor will never be called after form reset(e.g. in readonly event mode) resetCombo(); scheduler.detachEvent(id); }); function resetCombo(){ if(node._combo && node._combo.DOMParent) { var combo = node._combo; if(combo.unload){ combo.unload(); }else if(combo.destructor){ combo.destructor(); } // dhtmlxCombo 4.1.0 bug combo.DOMParent = combo.DOMelem = null; } } })(); window.dhx_globalImgPath = config.image_path||'/'; node._combo = new dhtmlXCombo(node, config.name, node.offsetWidth-8); if (config.onchange) node._combo.attachEvent("onChange", config.onchange); if (config.options_height) node._combo.setOptionHeight(config.options_height); var combo = node._combo; combo.enableFilteringMode(config.filtering, config.script_path||null, !!config.cache); if (!config.script_path) { // script-side filtration is used var all_options = []; for (var i = 0; i < config.options.length; i++) { var option = config.options[i]; var single_option = [ option.key, option.label, option.css ]; all_options.push(single_option); } combo.addOption(all_options); if (ev[config.map_to]) { var index = combo.getIndexByValue(ev[config.map_to]); combo.selectOption(index); } } else { // server-side filtration is used var selected_id = ev[config.map_to]; if (selected_id) { if (config.cached_options[selected_id]) { combo.addOption(selected_id, config.cached_options[selected_id]); combo.disable(1); combo.selectOption(0); combo.disable(0); } else { dhtmlxAjax.get(config.script_path+"?id="+selected_id+"&uid="+scheduler.uid(), function(result){ var option = result.doXPath("//option")[0]; var label = option.childNodes[0].nodeValue; config.cached_options[selected_id] = label; combo.addOption(selected_id, label); combo.disable(1); combo.selectOption(0); combo.disable(0); }); } } else { combo.setComboValue(""); } } }, get_value:function(node,ev,config) { var selected_id = node._combo.getSelectedValue(); // value = key if (config.script_path) { config.cached_options[selected_id] = node._combo.getSelectedText(); } return selected_id; }, focus:function(node){ } }; scheduler.form_blocks['radio']={ render:function(sns) { var res = ''; res += "