简体   繁体   中英

PrimeFaces DataTable with scrollable header

I have a PrimeFaces dataTable and I want to make its header scrollable. I am going to embed an image into header so when the content is scrolled down, image should disappear. Code looks like;

 <p:dataTable id="dataTable" liveScroll="true"
                     value="#{....}" var="...." scrollable="true"
                     scrollRows="3"
                     scrollHeight="490" rows="3">
            <f:facet name="header">
                <p:graphicImage value="/images/..."></p:graphicImage>
            </f:facet>
            <p:column ........

you can put it into a scrollPanel

<p:scrollPanel>
     <p:dataTable id="dataTable" liveScroll="true"
                 value="#{....}" var="...." scrollable="true"
                 scrollRows="3"
                 scrollHeight="490" rows="3">
        <f:facet name="header">
            <p:graphicImage value="/images/..."></p:graphicImage>
        </f:facet>
        ...
</p:scrollPanel>

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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