DataTable, resizeMode="expand" hiding columns provoke the stretching of the remaining ones

UI Components for JSF
Post Reply
Dasister
Posts: 2
Joined: 24 Jul 2018, 17:22

16 Aug 2018, 11:23

Hello.
I have DataTable with resizable columns and resizeMode set to "expand".
When I hide some columns, the remains one becomes wider to fit table's width.
Is this expected behavior with resizeMode="expand"?

Image
Image

How to reproduce:
XHTML:

Code: Select all

<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:p="http://primefaces.org/ui"
      xmlns:h="http://java.sun.com/jsf/html">

    <h:head>
        <title>PrimeFaces Test</title>
    </h:head>
    <h:body>

        <p:commandButton id="toggler" value="Toggler" />
        <p:columnToggler trigger="toggler" datasource="tbl" />
        <p:dataTable id="tbl" resizableColumns="true" resizeMode="expand">
            <p:column headerText="Column 1" />
            <p:column headerText="Column 2" />
            <p:column headerText="Column 3" />
            <p:column headerText="Column 4" />
            <p:column headerText="Column 5" />
            <p:column headerText="Column 6" />
        </p:dataTable>

    </h:body>
</html>
Resize any column before hiding them.

kukeltje
Expert Member
Posts: 9605
Joined: 17 Jun 2010, 13:34
Location: Netherlands

16 Aug 2018, 15:39

PrimeFaces 2.1?

Dasister
Posts: 2
Joined: 24 Jul 2018, 17:22

16 Aug 2018, 16:09

PF 6.1, 6.2 and 6.3-SNAPSHOT behave the same way.
Application Server doesn't matter.

Post Reply

Return to “PrimeFaces”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 29 guests