Hello,
I have been trying to programmatically create ComboButtons (containing drop-down items) to put in a toolbar without any success. I've searched the web far and near and have been unable to come up with any answers as to if it's possible and how to get these ComboButtons to work correctly.
Can anyone give me an example as to how this is done?
Thanks much!

This may get you started: /*
This may get you started:
//create your toolbar. //create the menu and child items. var mnu = new dijit.Menu({id:'ff',style:'display:none'}); dojo.body().appendChild(mnu.domNode); var item = new dijit.MenuItem({label:'1'}); mnu.addChild(item); item = new dijit.MenuItem({label:'2'}); mnu.addChild(item); mnu.startup(); //create the ComboButton and add to the toolbar. var btn = new dijit.form.ComboButton({label:'ComboButton',dropDown:mnu}); toolbar.addChild(btn); //voila!Wow, perfect - Thank
Wow, perfect - Thank you!!!
I understand everything there except this one line:
If I may ask, to avoid similar questions, what is the purpose of that line?
Thanks again, I appreciate the help!
A new element/widget must be
A new element/widget must be in the DOM before it can be referenced later. Creating some types of widgets does append them "behind the scenes" to the document body, e.g., Dialog, etc., widgets that really have no "normal" parent to which they must be attached. But, to be safe, I appended it to the body element to get it out of the way and made it display:none so it wouldn't be visible until the ComboButton arrow is clicked.
You can probably remove that line, as well as the mnu.startup() line. Either/both may not be needed. Just an abundance of caution.