Table RowGroup filter is not working on headers

UI Components for JSF
Post Reply
ferran
Posts: 9
Joined: 04 May 2017, 12:19

26 Jun 2017, 12:58

Hello,
I am trying to search with filter in a entire table RowGroup (https://www.primefaces.org/showcase/ui/ ... roup.xhtml). Include each header instead only the content of every header.
Reproducing the table's example, I have created:
Image

Where you can see, that if you use the searcer input at right-top, the results are filtering only the Green parts and not the Red ones.

The code I have created is:
XHTML:

Code: Select all

       <p:dataTable var="car" value="#{grouperController.cars}" sortBy="#{car.brand}" expandableRowGroups="true" widgetVar="carsTable">

            <f:facet name="header">
                <p:inputText id="globalFilter" type="hidden" value="" immediate="true"
                             styleClass="real-global-filter">
                    <f:validateBean disabled="true"/>
                </p:inputText>
            </f:facet>

            <p:headerRow>
                <p:column colspan="3" filterBy="#{car.brand}">
                    <h:outputText value="#{car.brand}" />
                </p:column>
            </p:headerRow>
            <p:column headerText="Year" filterBy="#{car.year}">
                <h:outputText value="#{car.year}" />
            </p:column>
            <p:column headerText="Color" filterBy="#{car.color}">
                <h:outputText value="#{car.color}" />
            </p:column>
            <p:column headerText="Id" filterBy="#{car.id}">
                <h:outputText value="#{car.id}" />
            </p:column>
            <p:summaryRow>
                <p:column colspan="2" style="text-align:right">
                    <h:outputText value="Total:" />
                </p:column>
                <p:column>
                    <h:outputText value="#{grouperController.randomPrice}">
                        <f:convertNumber type="currency" currencySymbol="$" />
                    </h:outputText>
                </p:column>
            </p:summaryRow>
        </p:dataTable>

JS:

Code: Select all

function dtf_updateTableGlobalFilter(widgetVar,filterObj,realGFClass,auxGFClass) {
	var newValue = jQuery(filterObj).val();
	jQuery("."+realGFClass).val(newValue);
	jQuery("."+auxGFClass).val(newValue);
	PF(widgetVar).filter();
}
Thank you in advance
Ferran

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

27 Jun 2017, 12:36

I have a hard time understanding what your problem is. That starts by the fact that the search-input is at the top LEFT and not as you stated at the right.

Post Reply

Return to “PrimeFaces”

  • Information
  • Who is online

    Users browsing this forum: Google [Bot] and 61 guests