问题描述
创建了常规的primefaces数据表,冻结了4列,并且可滚动15列。
当浏览器大小减小时,数据表将调整为较小的宽度,但在最大化时,它不会对宽度增加做出响应。下面是代码,
<p:dataTable id="usersList" var="user" widgetvar="userList"
value="#{UserBean.userList}" scrollRows="15" style="overflow-x: hidden;"
scrollable="true" scrollWidth="99%" frozenColumns="2"
emptyMessage="No records found.">
<p:ajax event="filter" oncomplete="updatefilters()"/>
<p:column headerText="User ID" style="width:70px; height: auto; vertical-align: top;">
<h:outputText id="userId" value="#{user.userId}" style="text-align: center;"/>
</p:column>
<p:column headerText="User Name"
sortBy="#{user.userName}" sortOrder="ascending" filterable="true"
filterBy="#{user.userName}" filterMatchMode="in"
style="width:120px; height: auto; vertical-align: top;">
<f:facet name="filter">
<p:selectCheckBoxMenu label="" onchange="PF('userList').filter()"
scrollHeight="200" updateLabel="true">
<f:selectItems value="#{UserBean.userListForFilter}" />
</p:selectCheckBoxMenu>
</f:facet>
<h:outputText id="userName" value="#{user.userName}" style="height: 30px;"/>
</p:column>
<p:column headerText="User City" style="width:70px; height: auto; vertical-align: top;">
<h:outputText id="userCity" value="#{user.city}" style="text-align: center;"/>
</p:column>
<p:column headerText="Date Created" style="width:100px; height: auto; white-space: Nowrap; vertical-align: top;">
<h:outputText id="createdDate" value="#{user.createdTs}">
<f:convertDateTime pattern="MM/dd/yyyy"/>
</h:outputText>
</p:column>
</p:dataTable>
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)