I’m trying to create a dijit DropDownButton with a DropDownMenu and populate it with menu items using dojo mvc. Is this possible or do I need to manually create/delete MenuItems? I have tried the below but the DropDownMenu is not getting populated.
<div data-dojo-attach-point="person_select_btn" data-dojo-type="dijit/form/DropDownButton">
<div data-dojo-attach-point="person_list_drop_menu" data-dojo-type="dijit/DropDownMenu">
<div data-dojo-type="dojox/mvc/Repeat"
data-dojo-props="exprchar: '#' children: at(this.personListModel, 'model')">
<div data-dojo-type="dijit/MenuItem"
data-dojo-props="label: at('rel:#{this.index}','personName')">
</div>
</div>
</div>
</div>
Dojo 1.8 introduced
dojox/mvc/WidgetListwhich effectively replacesdojox/mvc/Repeat. There is a way to create repeating menu items withdojox/mvc/WidgetList, like (replace /path/to/dojotoolkit with the path of Dojo Toolkit in your environment):Above approach won’t work with different types of menus (like
CheckedMenuItem), though. Upcoming release of Dojo will address that: http://trac.dojotoolkit.org/changeset/30158/dojo