简体   繁体   English

防止Dojo DropdownMenu关闭

[英]Prevent Dojo DropdownMenu from closing

I use a Dojo Enhanced Grid to display various data. 我使用Dojo增强网格来显示各种数据。 With a DropDownMenu I give the user the ability to show additional colums. 使用DropDownMenu,我使用户能够显示其他列。
But this is a little bit uncomfortable. 但这有点不舒服。 Because the user has to click for every new colum onto the menu. 因为用户必须为每个新的列单击菜单。
Is there a possibility to prevent the DropDownMenu from closing? 有可能防止DropDownMenu关闭吗? Or should I use another widget for this? 还是应该为此使用其他小部件?

I'd suggest you look into Dojo dgrid , and the ColumnHider extension . 我建议您研究一下Dojo dgrid和ColumnHider 扩展 It effectively recreates what you're doing, and is available out-of-the-box, including the feature you're after. 它可以有效地重新创建您正在做的事情,并且开箱即用,包括您所追求的功能。

An alternate solution is to use a dijit/TooltipDialog , whose default behavior is to stay open when one of its contents is clicked. 另一种解决方案是使用dijit / TooltipDialog ,其默认行为是在单击其内容之一时保持打开状态。

yourGrid.openDropDown(); yourGrid.openDropDown(); will open the menu back again, and you would not really notice that it was displayed back again after a close. 将再次打开菜单,并且您不会真正注意到关闭后再次显示了该菜单。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM