微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

当浏览器大小减小然后最大化时,带有冻结列的Primefaces数据表将响应

如何解决当浏览器大小减小然后最大化时,带有冻结列的Primefaces数据表将响应

创建了常规的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 举报,一经查实,本站将立刻删除。