summaryrefslogtreecommitdiffstats
path: root/codebase/ext/dhtmlxscheduler_editors.js
blob: 8b63722eeef81852d1e8e0ecdc44ed671846d72f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
/*
dhtmlxScheduler v.4.2.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(e){e.cached_options||(e.cached_options={});var t="";return t+="<div class='"+e.type+"' style='height:"+(e.height||20)+"px;' ></div>"},set_value:function(e,t,i,s){!function(){function t(){e._combo&&e._combo.DOMParent&&e._combo.destructor()}t();var i=scheduler.attachEvent("onAfterLightbox",function(){t(),scheduler.detachEvent(i)})}(),window.dhx_globalImgPath=s.image_path||"/",e._combo=new dhtmlXCombo(e,s.name,e.offsetWidth-8),s.onchange&&e._combo.attachEvent("onChange",s.onchange),s.options_height&&e._combo.setOptionHeight(s.options_height);
var a=e._combo;if(a.enableFilteringMode(s.filtering,s.script_path||null,!!s.cache),s.script_path){var n=i[s.map_to];n?s.cached_options[n]?(a.addOption(n,s.cached_options[n]),a.disable(1),a.selectOption(0),a.disable(0)):dhtmlxAjax.get(s.script_path+"?id="+n+"&uid="+scheduler.uid(),function(e){var t=e.doXPath("//option")[0],i=t.childNodes[0].nodeValue;s.cached_options[n]=i,a.addOption(n,i),a.disable(1),a.selectOption(0),a.disable(0)}):a.setComboValue("")}else{for(var r=[],d=0;d<s.options.length;d++){var o=s.options[d],l=[o.key,o.label,o.css];
r.push(l)}if(a.addOption(r),i[s.map_to]){var h=a.getIndexByValue(i[s.map_to]);a.selectOption(h)}}},get_value:function(e,t,i){var s=e._combo.getSelectedValue();return i.script_path&&(i.cached_options[s]=e._combo.getSelectedText()),s},focus:function(){}},scheduler.form_blocks.radio={render:function(e){var t="";t+="<div class='dhx_cal_ltext dhx_cal_radio' style='height:"+e.height+"px;' >";for(var i=0;i<e.options.length;i++){var s=scheduler.uid();t+="<input id='"+s+"' type='radio' name='"+e.name+"' value='"+e.options[i].key+"'><label for='"+s+"'> "+e.options[i].label+"</label>",e.vertical&&(t+="<br/>")
}return t+="</div>"},set_value:function(e,t,i,s){for(var a=e.getElementsByTagName("input"),n=0;n<a.length;n++){a[n].checked=!1;var r=i[s.map_to]||t;a[n].value==r&&(a[n].checked=!0)}},get_value:function(e){for(var t=e.getElementsByTagName("input"),i=0;i<t.length;i++)if(t[i].checked)return t[i].value},focus:function(){}},scheduler.form_blocks.checkbox={render:function(e){return scheduler.config.wide_form?'<div class="dhx_cal_wide_checkbox" '+(e.height?"style='height:"+e.height+"px;'":"")+"></div>":""
},set_value:function(e,t,i,s){e=document.getElementById(s.id);var a=scheduler.uid(),n="undefined"!=typeof s.checked_value?t==s.checked_value:!!t;e.className+=" dhx_cal_checkbox";var r="<input id='"+a+"' type='checkbox' value='true' name='"+s.name+"'"+(n?"checked='true'":"")+"'>",d="<label for='"+a+"'>"+(scheduler.locale.labels["section_"+s.name]||s.name)+"</label>";if(scheduler.config.wide_form?(e.innerHTML=d,e.nextSibling.innerHTML=r):e.innerHTML=r+d,s.handler){var o=e.getElementsByTagName("input")[0];
o.onclick=s.handler}},get_value:function(e,t,i){e=document.getElementById(i.id);var s=e.getElementsByTagName("input")[0];return s||(s=e.nextSibling.getElementsByTagName("input")[0]),s.checked?i.checked_value||!0:i.unchecked_value||!1},focus:function(){}};
//# sourceMappingURL=../sources/ext/dhtmlxscheduler_editors.js.map