/* dhtmlxScheduler v.4.1.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.attachEvent("onTimelineCreated", function (obj){ if(obj.render == "tree") { obj.y_unit_original = obj.y_unit; obj.y_unit = scheduler._getArrayToDisplay(obj.y_unit_original); scheduler.attachEvent('onOptionsLoadStart', function(){ obj.y_unit = scheduler._getArrayToDisplay(obj.y_unit_original); }); scheduler.form_blocks[obj.name]={ render:function(sns) { var _result = "
"; return _result; }, set_value:function(node,value,ev,config){ var options = scheduler._getArrayForSelect(scheduler.matrix[config.type].y_unit_original, config.type); node.innerHTML = ''; var temp_select = document.createElement('select'); node.appendChild(temp_select); var select = node.getElementsByTagName('select')[0]; if (!select._dhx_onchange && config.onchange) { select.onchange = config.onchange; select._dhx_onchange = true; } for (var i = 0; i < options.length; i++) { var temp_option = document.createElement('option'); temp_option.value = options[i].key; if(temp_option.value == ev[scheduler.matrix[config.type].y_property]) temp_option.selected = true; temp_option.innerHTML = options[i].label; select.appendChild(temp_option); } }, get_value:function(node,ev,config){ return node.firstChild.value; }, focus:function(node){ } }; } }); scheduler.attachEvent("onBeforeSectionRender", function (render_name, y_unit, timeline){ var res = {}; if(render_name == "tree"){ var height; // section 1 var tr_className, style_height, td_className; var div_expand; // section 3 var table_className; if(y_unit.children) { height = timeline.folder_dy||timeline.dy; if(timeline.folder_dy && !timeline.section_autoheight) { style_height = "height:"+timeline.folder_dy+"px;"; } tr_className = "dhx_row_folder"; td_className = "dhx_matrix_scell folder"; div_expand = " "; table_className = (timeline.folder_events_available)?"dhx_data_table folder_events":"dhx_data_table folder"; } else { height = timeline.dy; tr_className = "dhx_row_item"; td_className = "dhx_matrix_scell item"+(scheduler.templates[timeline.name+"_scaley_class"](y_unit.key, y_unit.label, y_unit) ? " "+scheduler.templates[timeline.name+"_scaley_class"](y_unit.key, y_unit.label, y_unit) : ''); div_expand = ''; table_className = "dhx_data_table"; } var td_content = "