JARCH SHOWCASE
JARCH SHOWCASE
DataTable - Column Resize Columns can be resized in two ways, with a helper or live.

Basic Resize

Basic Resize
IdYearBrandColor
bb5b3fd52006VolvoBlack
66c9ec511988MercedesYellow
ba32a9461990VolkswagenOrange
e2729b891993FiatWhite
a61fa4ed1968RenaultWhite
07e57bed1977FiatBrown
dddec14f1975MercedesMaroon
f7642a5d1984VolkswagenOrange
5f0879691998AudiBlack
101f91611996VolvoBrown

Live Resize with Callback

IdYearBrandColor

Expand Mode with Grouping

ManufacturerSale Rate
SalesProfit
Last YearThis YearLast YearThis Year
Apple32%1%$ 63.952,00$ 24.853,00
Samsung70%79%$ 16.389,00$ 23.060,00
Microsoft98%16%$ 28.867,00$ 82.868,00
Philips67%72%$ 73.875,00$ 46.251,00
Sony65%56%$ 34.421,00$ 75.929,00
LG36%87%$ 73.802,00$ 62.009,00
Sharp1%9%$ 12.101,00$ 57.933,00
Panasonic96%10%$ 69,00$ 34.561,00
HTC29%49%$ 99.879,00$ 70.196,00
Nokia89%48%$ 79.238,00$ 26.536,00
Totals:$482.593$504.196
<a:form id="form">
    <a:growl id="msgs" showDetail="true" />

    <h3 style="margin-top:0">Basic Resize</h3>
    <a:dataTable id="cars1" var="car" value="#{dtResizableColumnsView.cars1}" resizableColumns="true" style="margin-bottom:20px">
        <f:facet name="header">
            Basic Resize
        </f:facet>
        <a:column headerText="Id">
            <h:outputText value="#{car.id}" />
        </a:column>
        <a:column headerText="Year">
            <h:outputText value="#{car.year}" />
        </a:column>
        <a:column headerText="Brand">
            <h:outputText value="#{car.brand}" />
        </a:column>
        <a:column headerText="Color">
            <h:outputText value="#{car.color}" />
        </a:column>
    </a:dataTable>

    <h3>Live Resize with Callback</h3>
    <a:dataTable id="cars2" var="car" value="#{dtResizableColumnsView.cars2}" resizableColumns="true" liveResize="true" style="margin-bottom:20px">
        <a:ajax event="colResize" update=":form:msgs" listener="#{dtResizableColumnsView.onResize}" />
        <f:facet name="header">

        </f:facet>
        <a:column headerText="Id" id="id">
            <h:outputText value="#{car.id}" />
        </a:column>
        <a:column headerText="Year" id="year">
            <h:outputText value="#{car.year}" />
        </a:column>
        <a:column headerText="Brand" id="brand">
            <h:outputText value="#{car.brand}" />
        </a:column>
        <a:column headerText="Color" id="color">
            <h:outputText value="#{car.color}" />
        </a:column>
    </a:dataTable>

    <h3>Expand Mode with Grouping</h3>
    <a:dataTable var="sale" value="#{dtGroupView.sales}" resizableColumns="true" resizeMode="expand">
        <f:facet name="header">

        </f:facet>

        <a:columnGroup type="header">
            <a:row>
                <a:column rowspan="3" headerText="Manufacturer" />
                <a:column colspan="4" headerText="Sale Rate" />
            </a:row>
            <a:row>
                <a:column colspan="2" headerText="Sales" />
                <a:column colspan="2" headerText="Profit" />
            </a:row>
            <a:row>
                <a:column headerText="Last Year" />
                <a:column headerText="This Year" />
                <a:column headerText="Last Year" />
                <a:column headerText="This Year" />
            </a:row>
        </a:columnGroup>

        <a:column>
            <h:outputText value="#{sale.manufacturer}" />
        </a:column>
        <a:column>
            <h:outputText value="#{sale.lastYearProfit}%" />
        </a:column>
        <a:column>
            <h:outputText value="#{sale.thisYearProfit}%" />
        </a:column>
        <a:column>
            <h:outputText value="#{sale.lastYearSale}">
                <f:convertNumber type="currency" currencySymbol="$" />
            </h:outputText>
        </a:column>
        <a:column>
            <h:outputText value="#{sale.thisYearSale}">
                <f:convertNumber type="currency" currencySymbol="$" />
            </h:outputText>
        </a:column>

        <a:columnGroup type="footer">
            <a:row>
                <a:column colspan="3" style="text-align:right" footerText="Totals:" />
                <a:column footerText="$#{dtGroupView.lastYearTotal}" />

                <a:column footerText="$#{dtGroupView.thisYearTotal}" />
            </a:row>
        </a:columnGroup>
    </a:dataTable>
</a:form>
                
JARCH, Copyright © 2022 All rights reserved. Running JARCH 24.3.0-SNAPSHOT on PrimeFaces-12.0.0 on Mojarra-2.3.13.