I am using lightbox with several custom fields:
As an example.
var sections1=[
{key:1, label:“Unassigned”},
{key:2, label:“Room A”},
{key:3, label:“Room B”},
{key:4, label:“Meeting”}
Is there a way to make key 1 be the default value rather than forcing the user to pick?
];
You can redefine the set_value method (dhtmlx.com/dhxdocs/doku.php?id=d … tails_form):
scheduler.form_blocks.select.set_value = function(node,value,ev){
node.firstChild.value=value||1;
}
Still a bit confusing:
I have lightbox configured as:
scheduler.config.lightbox.sections=[
What I want to do is set custom and loc to the first entry in the list?
I tried:
scheduler.form_blocks.select.set_value=function(node,value,ev){ node.firstChild.value = 1;}
which works,
but then in the units view (I have 2) wherein I use the type:select for both, when I create an event under that unit it also picks up the value 1 rather than the unit view it was created in. I only want the value 1 when the event is created in the non-unit view for that unit, i.e. week, month, or day view.
Is there a solution to this?
The soluution provided in the previous answer (dhtmlx.com/docs/products/kb/inde … 58&a=21705) was:
scheduler.form_blocks.select.set_value = function(node,value,ev){
node.firstChild.value = value||1;
}
Try to use it.
Alex,
Awesome, works like a charm! I think I found the other line of code on a prior knowledge post rather than using your suggested version. My sincere apologies, and to you group as a whole thanks for ansering my unending stream of questions.
-Mahesh