Categories | Question details Back To List | ||
dhtmlx schdeular & custom lightbox: move select text automatically into the descrition field, & auto select time revisited Amit has noted on a prior post: There are two definitions of the set_value method of my_select object: scheduler.form_blocks.my_select = { and scheduler.form_blocks.my_select.set_value = function(node,value,ev){ Try to use one. <------------------------------------> There should be a way to combine the javasciript functions, so I can fill both the lightbox text and set the times on a single onchange event. I am trying to work on this, but not succeeeding very well. Thanks for your help so far. Here is my lightbox confguration: scheduler.config.lightbox.sections=[ Here is the function code: var select = scheduler.form_blocks.select; //Add in selected procedure text into description field scheduler.form_blocks.my_select.set_value = function(node,value,ev){
Each will work independantly, but not together. -Mahesh
Answer posted by Alex(support) on Dec 11, 2009 01:28 Only the latest second set_value definition will be applied (you have defined set_value method twice). You should use only one method. For example: scheduler.form_blocks.my_select = { set_value : function(node,value,ev){ mode = node.firstChild; mode.value=value||""; var txta = document.getElementsByTagName("textarea")[0]; var selectEl = node.firstChild; selectEl.onchange = function(e){ set_end_time(e) var index = selectEl.selectedIndex; txta.value = selectEl.options[index].text; } }, focus : select.focus } Answer posted by mahesh on Dec 11, 2009 13:52 Thanks-it works!! |