如何自动调整底层子菜单的长度 [英] how to auto adjust the length of submenu of primefaces

查看:128
本文介绍了如何自动调整底层子菜单的长度的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用< p:tieredMenu model =#{ServerGroupMgmtBean.model}id =serverGroupMenu/> 创建一个动态菜单。如果子菜单中有许多菜单项,则某些菜单不能在一行中显示。

解决方案

您可以直接使用样式css更改项目的宽度,您可以获取组件的样式类 c

检查浏览器的函数,将此代码片段添加到您的facelet文件(.xhtml,...) pre> < style type =text / css>
.ui-menu.ui-menu-parent.ui-menu-child {
width:120%!important; //或任何你想要的东西
}
< / style>


I create a dynamic menu with <p:tieredMenu model="#{ServerGroupMgmtBean.model}" id="serverGroupMenu"/>. If there are many menu items in the Submenu, some of the menus cannot display in one row. Is there any solution to fix this?

解决方案

You can change item's width by using style css directly, you can get component's style class by Inspect element function of browser, add this snippet code to your faceslet file(.xhtml,...):

<style type="text/css">
  .ui-menu.ui-menu-parent.ui-menu-child{
     width: 120 % !important; // or anything you want
  }
</style>

这篇关于如何自动调整底层子菜单的长度的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆