DataTable with column toggler renders incorrect

Forum rules
Please note that response time for technical support is within 3-5 business days.
Post Reply
Netinium
Posts: 23
Joined: 06 Jul 2017, 16:09

23 Aug 2017, 10:54

When the example from:

https://www.primefaces.org/showcase/ui/ ... gler.xhtml

Code: Select all

<p:dataTable id="cars" var="car" value="#{dtBasicView.cars}">
    <f:facet name="header">
        List of Cars
 
        <p:commandButton id="toggler" type="button" value="Columns" style="float:right" icon="ui-icon-calculator" />
        <p:columnToggler datasource="cars" trigger="toggler" />
    </f:facet>
is used in Poseidon the column toggler menu renders outside the title facet. As if a new column is rendered outside of the table.
the only workaround is to use

Code: Select all

style="float:center"
but i would like to use

Code: Select all

style="float:right"
could you fix this in the template?
Is there a workaround I can apply in the meantime?
Can the toggler be added in the demo app?

============


The entire code:

Code: Select all

<p:dataTable id="cars" var="car" value="#{dtBasicView.cars}">
    <f:facet name="header">
        List of Cars
 
        <p:commandButton id="toggler" type="button" value="Columns" style="float:right" icon="ui-icon-calculator" />
        <p:columnToggler datasource="cars" trigger="toggler" />
    </f:facet>
 
    <p:column headerText="Id">
        <h:outputText value="#{car.id}" />
    </p:column>
 
    <p:column headerText="Year">
        <h:outputText value="#{car.year}" />
    </p:column>
 
    <p:column headerText="Brand">
        <h:outputText value="#{car.brand}" />
    </p:column>
 
    <p:column headerText="Color">
        <h:outputText value="#{car.color}" />
    </p:column>
 
    <p:column headerText="Price">
        <h:outputText value="#{car.price}">
            <f:convertNumber type="currency" currencySymbol="$" />
        </h:outputText>
    </p:column>
</p:dataTable>

Netinium
Posts: 23
Joined: 06 Jul 2017, 16:09

06 Sep 2017, 11:12

Any update on this issue? I would really like to use column toggling in Poseidon.

mert.sincan
Posts: 5281
Joined: 29 Jun 2013, 12:38

13 Sep 2017, 09:13

Sorry for the late reply, our showcase demo has the following css for columnToggler demo;

Code: Select all

.ui-datatable-header {
        height: 30px
}
Please try it.

Netinium
Posts: 23
Joined: 06 Jul 2017, 16:09

13 Sep 2017, 09:28

The layout of the header text is a bit off vertical centre after this fix, but the menu is shown at the correct place. Thank you, this helps a lot.

Could you add this to the default css in a future (service pack) release?

mert.sincan
Posts: 5281
Joined: 29 Jun 2013, 12:38

19 Sep 2017, 07:52

Please try for header issue;

Code: Select all

body .ui-datatable .ui-datatable-header {
   line-height: 2.1em;
}
Could you add this to the default css in a future (service pack) release?
- Unfortunately, we don't think of adding it into next release. Because users can use link component, h:commandButtton etc. instead of p:commandButton. You can add it into your project.

Post Reply

Return to “Poseidon - PrimeFaces”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 3 guests