Parent and child combo boxes, Please help, somewhat urgent!

In my scheduler script I have the following code (based on snippet found on this forum):

[code]scheduler.form_blocks[“my_editor”]={

	render:function(sns){
    return "<div class='dhx_cal_ltext' style='height:45px;margin:0px;'><table border='0' width='100%' cellpadding='0' cellspacing='0'><tr><td><div style='color: navy; float:left;'>Customer:</div><div id='combo_zone_customer' style='width:450px;float:right;'></div></td><td width='5px'></td></tr><tr><td><div style='color: navy;float:left;'>Address:</div><div id='combo_zone_address' style='width:450px;float:right;'></td><td width='5px'></td></tr></table><input type='hidden'></div><input type='hidden'></div>";
     },
	 set_value:function(node,value,ev){
	 var inps = node.getElementsByTagName("INPUT");
	 if (!node.combos){

window.dhx_globalImgPath = “…/…/combo/imgs/”;
var comboA = node.comboA = new dhtmlXCombo(“combo_zone_customer”,“dummy”,“450px”);
comboA.enableFilteringMode(true, “…/…/combo/autocomplete.asp?uid=<%=uid%>&ter=<%=currterr%>”, true, true);
comboA.loadXML("…/…/combo/autocomplete.asp?uid=<%=uid%>&ter=<%=currterr%>",function(){
comboA.setComboValue(ev.customer_drop||"");
comboA.attachChildCombo(comboB, “…/…/combo/autocompleteloc.asp”);
});

var comboB = node.comboB = new dhtmlXCombo(“combo_zone_address”,“dummy”,“450px”);

comboB.readonly(true);
comboB.loadXML("…/…/combo/autocompleteloc.asp",function(){
comboB.setComboValue(ev.address_drop||"");
});
node.combos = true; //added! // CHANGED
return;
}

node.comboA.setComboValue(ev.customer_drop||""); // CHANGED
node.comboB.setComboValue(ev.address_drop||""); // CHANGED
},

     get_value:function(node,ev){

        var inps = node.getElementsByTagName("INPUT");
        ev.customer_drop=   node.comboA.getComboText();
        ev.address_drop=      node.comboB.getComboText();


     },

     focus:function(node){

        var inps = node.getElementsByTagName("INPUT");
        inps[0].focus();
     }
  }
[/code]

And in the lightbox section I have:

{ name:"customer", map_to:"dummy", type:"my_editor" },

How do I map comboA and comboB to lightbox form elements, or rather, how do I retrieve the values in my dataprocessor (written in ASP) script?

My dataprocessor tries to retrieve them like this:

custid = request.Form(eventID&"_customer_drop") addressloc = request.Form(eventID&"_address_drop")

but that is not working.

Are comboboxes initialized correctly on client side, and during edit already existing event shows valid values?

The code which you are using looks correct

ev.customer_drop= node.comboA.getComboText();

This line save current text ( not the value! ) from combo in the named property and on server side it will be a part of form submit, with name as
{event_id}_customer_drop

Thank you! Turns out I was expecting the values not the text. Changed my dataprocessor and db fields accordingly. I also added additional fields for dp to retrieve values… now works lovely:

get_value:function(node,ev){ var inps = node.getElementsByTagName("INPUT"); ev.customer_drop= node.comboA.getComboText(); ev.address_drop= node.comboB.getComboText(); ev.cusid= node.comboA.getSelectedValue(); ev.cusloc= node.comboB.getSelectedValue(); },

However, when I click on an event where these values exist already, it only shows me comboA on the lightbox… is there a way of showing the child combo box either always, or at least when there is a value in db for it?

normally, when you setting value for master combo, child one will be shown automatically. So if ev.customer_drop is valid value in the next row

node.comboA.setComboValue(ev.customer_drop||"")

child combo must appear. Anyway you can force it by adding

node.comboA.showSubCombo(node.comboA, true);

Maybe I’m not understanding correctly. I now have :

node.comboA.setComboValue(ev.customer_drop||""); // CHANGED node.comboA.showSubCombo(node.comboA, true); node.comboB.setComboValue(ev.address_drop||""); // CHANGED

But comboB is not shown on the lightbox so I may not be doing it right…

Basically, when editing an existing event, where the comboB and comboA both have underlying data in them, that’s when comboB needs to be visible. Having it invisible is counter-intuitive for the user (“I already selected an address, dang it!”). Any ideas?

Also, I have tried to create a button similar to the recurring button, to show/hide the notes field but not enable/disable notes (just a simple roll-up/roll-down of the div). Can you point me in the right direction for this? The field needs to be “rolled-up” as default. Maybe I’ll have to repaint the lightbox on every event edit click?


solved the main issue of comboB not showing. had to place the lines so:

comboA.setComboValue(ev.customer_drop||""); comboA.attachChildCombo(comboB, "../../combo/autocompleteloc.asp"); node.comboA.showSubCombo(node.comboA, true);

Still need some help on the issue of the Notes field hide/show though…

Button can be added as

docs.dhtmlx.com/doku.php?id=dhtm … ion_header

To hide show you can use code similar to
docs.dhtmlx.com/doku.php?id=dhtm … ome_events
just alter height of element instead of fully hidding it.

Woohoo! You are a star! Thanks so much!