本文介绍了PrimeFaces DashBoard列宽的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个大问题,就是到现在我都找不到解决方案...我寻找了与我的问题相同的相似产品,但也没有找到解决方案

I have a big problem that i couldn't find a solution for it till now ...I looked for similar that have the same of my problem and i didn't find solution too

问题:我想为仪表板中的仪表板列添加不同的宽度以进行不同的布局,我发现了创建仪表板的两种方法,首先是在bean中创建模型,然后在其中添加 DashboardColumns 在向其中添加了小部件之后,bean也是如此,其次是通过标签< p:dashboardColumn> 创建列,这是第一个选项的问题,即在xhtml文件中创建没有实际列的列,这使我可以控制css的每一个列,以及我发现可以通过

the problem:i want to add different widths to dashboard columns in my dashboard to make different layouts , i found two ways in creation of dashboard by the way , first by creating model in my bean and add to it DashboardColumns in the bean too after adding widgets to it , second by creating columns by tags <p:dashboardColumn> and here's the problem the first option means create columns without real columns in the xhtml file that make me control the css of every column alone , and the way i found that i can edit default css for the column by

.pf-dashboard-column {width:200px;}

并写出我的样式,好吧,但是那样并不能使我能够为列设置不同的大小(宽度),第二个问题是 p:dashboardColumn 不是尽管我从网站上下载了lib并将其添加到我的IDE(classpath和源代码)中,但仍在我的primefaces lib中笔记:在我的开始标记中,我包含了 xmlns:p ="http://primefaces.org/ui" ,这些元素使我的primefaces组件正常工作,但< p:dashboardColumn> 无效但是在使用此标签的示例中,它包含 xmlns:p ="http://primefaces.prime.com.tr/ui" ,并且我在另一个lib中找到了它,但它并没有使我标记的工作方式类似于( p:selectOneMenu ),但使< p:dashboardColumn> 工作

and write my style , ok but that way didn't make me able to make different sizes (widths) for the columns , and the problem in the second one is p:dashboardColumn isn't in my primefaces lib although i downloaded the lib from the site and added it to my IDE (classpath and sources)note:in my opening tag i include xmlns:p="http://primefaces.org/ui" that make my primefaces components work but <p:dashboardColumn> not working but in examples that use this tag it includs xmlns:p="http://primefaces.prime.com.tr/ui" and this i found it in another lib but it doesn't make my tags work like (p:selectOneMenu) but make <p:dashboardColumn> work

...这是我的问题,我无法为列设置不同的宽度...任何帮助?

... that is my problem that i couldn't make different widths to columns ... any help???

另一件事是,当我调整浏览器的大小时,面板的顺序改变了,我也不知道为什么?

and another thing when i resize my browser the order of panels changes and i didn't know why ??

推荐答案

看看CSS nth-child选择器:

Have a look at the CSS nth-child selector:

http://www.w3schools.com/cssref/sel_nth-child.asp

.pf-dashboard-columnp:nth-child(1) {
  width: 400px;
}
.pf-dashboard-columnp:nth-child(2) {
  width: 500px;
}

请注意您的操作,您可能会发现其他元素是通过素面动态调整大小的,而不是在CSS中.

be careful what your doing though, you might find other elements have been sized by prime faces dynamically rather than in the CSS.

这篇关于PrimeFaces DashBoard列宽的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-05 19:14
查看更多