简体   繁体   English

Primefaces TreeTable排序崩溃

[英]Primefaces TreeTable sorting freze collapse

is it possible to keep the behaviour more stable? 是否可以使行为更稳定?

what I have: an Tree table with 3 columns, first has collapsed stuff in it if I open one and close it, then click on sort it is open after that 我所拥有的:一个有3列的树表,如果我打开一个树表并关闭它,则首先在其中折叠了东西,然后单击排序后它是打开的

what I would like to have: keep it closed if it was closed before sort 我要拥有的东西:如果在排序之前关闭了它,请保持关闭状态

 <h:form id="form">
    <p:treeTable value="#{ttBasicView.root}" var="document">
        <f:facet name="header">
            FritzBox Smart Home Daten
        </f:facet>
        <p:column headerText="Name" >
            <h:outputText value="#{document.name}" />
        </p:column>
        <p:column headerText="Gesamtverbrauch (in kWh)" sortBy="#{document.gesamtverbrauch}" actionListener="#{BasicView.expandAll}">
            <h:outputText value="#{document.gesamtverbrauch}" />
        </p:column>
        <p:column headerText="aktuelle Temperatur" sortBy="#{document.akttemperatur}">
            <h:outputText value="#{document.akttemperatur}" />
        </p:column>
        <p:column style="width:24px">
            <p:commandLink update=":form:documentPanel" oncomplete="PF('documentDialog').show()" title="View Detail" styleClass="ui-icon ui-icon-search">
                <f:setPropertyActionListener value="#{document}" target="#{ttBasicView.selectedDocument}" />
            </p:commandLink>
        </p:column>

    </p:treeTable>

    <p:dialog id="dialog" header="Document Detail" showEffect="fade" widgetVar="documentDialog" modal="true" resizable="false">
        <p:outputPanel id="documentPanel">
            <p:panelGrid  columns="2" columnClasses="label,value" rendered="#{not empty ttBasicView.selectedDocument}">
                <h:outputLabel for="name" value="Name: " />
                <h:outputText id="name" value="#{ttBasicView.selectedDocument.name}" style="font-weight:bold" />

                <h:outputLabel for="gesamtverbrauch" value="Gesamtverbrauch: " />
                <h:outputText id="gesamtverbrauch" value="#{ttBasicView.selectedDocument.gesamtverbrauch}" style="font-weight:bold" />

                <h:outputLabel for="akttemperatur" value="aktuelle Temperatur: " />
                <h:outputText id="akttemperatur" value="#{ttBasicView.selectedDocument.akttemperatur}" style="font-weight:bold" />
            </p:panelGrid>
        </p:outputPanel>
    </p:dialog>

</h:form>

排序之前 经过排序

That was my problem too. 那也是我的问题。 Try it in your treeTable : 在您的treeTable中尝试:

<p:ajax event="collapse" 
        onstart="handleLoadingStarted()"
        oncomplete="handleLoadingStopped()" />

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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