使用dijit / Toolbar始终呈现水平工具栏。我需要它是垂直的。
<div id="toolbar1" data-dojo-type="dijit/Toolbar"
><div data-dojo-type="dijit/form/Button" id="toolbar1.cut"
data-dojo-props="iconClass:'dijitEditorIcon dijitEditorIconCut', showLabel:false">Cut</div
><div data-dojo-type="dijit/form/Button" id="toolbar1.copy"
data-dojo-props="iconClass:'dijitEditorIcon dijitEditorIconCopy', showLabel:false">Copy</div
><div data-dojo-type="dijit/form/Button" id="toolbar1.paste"
data-dojo-props="iconClass:'dijitEditorIcon dijitEditorIconPaste', showLabel:false">Paste</div
><!-- The following adds a line between toolbar sections
--><span data-dojo-type="dijit/ToolbarSeparator"></span
><div data-dojo-type="dijit/form/ToggleButton" id="toolbar1.bold"
data-dojo-props="iconClass:'dijitEditorIcon dijitEditorIconBold', showLabel:false">Bold</div>
感谢
答案 0 :(得分:0)
Dojo的工具栏实际上不能垂直,但你可以做的是创建一个dijit / Menu,而不是默认设置它隐藏。
这样的事情应该有效:
<div data-dojo-type="dijit/Menu">
<div data-dojo-type="dijit/MenuItem" data-dojo-props="iconClass:'dijitEditorIcon dijitEditorIconCut'">Cut</div>
<div data-dojo-type="dijit/MenuItem" data-dojo-props="iconClass:'dijitEditorIcon dijitEditorIconCopy'">Copy</div>
</div>
如果您想以编程方式执行此操作,它也可以。只是不要指定targetNodeId,并在创建它时给小部件一个节点(或id)。
此外,如果您愿意,可以将MenuItem css修改为标准按钮(边框半径,框阴影等),但我看到的大多数垂直菜单最后使用的是更扁平的样式按钮。< / p>