我正在使用 primefaces 3.3 并在数据表下使用 p:rowExpansion 和 p:toggler。我想在选择另一行时折叠先前展开的行。
我有一个 id 为 reconcileTable 的数据表。
我们在 primefaces 中是否有任何功能来处理这种情况?
提前致谢!
代码片段::
<p:dataTable id="ux_reconciliation_table" widgetVar="reconcileTable">
<p:ajax event="rowSelect" listener="#{reconciliationBean.validateReconciliationAction}" update=":reconciliation_form:multiProcessBtn,:message_form_dialog :reconciliation_form:removeLatestSel" oncomplete="checkRowExpansion()"></p:ajax>
<p:ajax event="rowToggle" listener="#{reconciliationBean.onRowToggle}" update="ux_row_nonrequired_content "/>
<p:ajax event="rowUnselect" update=":reconciliation_form:multiProcessBtn"/>
<f:facet name="header">
<p:outputPanel>
<p:outputLabel value="#{resourceBundle['reconciliation.worksheet_search.label']} " styleClass="ux_reconciliation_datatable_header_text"/>
<p:inputText id="globalFilter" onkeyup="reconcileTable.filter()" styleClass="ux_reconciliation_input_search_field" />
<h:graphicImage value="../images/common/I_Search.png" styleClass="ux_dialog_search"/>
</p:outputPanel>
</f:facet>
<p:column id="Billing_MiscParty_PartyRole_Party_Organization_NameInfo_longName" sortBy="#{reconciliationDetail.payorName}" filterBy="#{reconciliationDetail.payorName}" filterMatchMode="contains" filterStyleClass="hide" styleClass="ux_ui-datatable-column ux_alpha-column">
<f:facet name="header">
<h:outputText value="" styleClass="ux_title_table_header_reconcile"/><br/>
<h:outputText value="#{resourceBundle['reconciliation.payor_insured.table.column']}" styleClass="ux_title_table_header_reconcile"/><br/>
</f:facet>
<h:panelGroup id="reconArrowTogglerLink">
<div class="#{reconciliationDetail.parentId == 0?'ux_reconciliation_togger_icon':'ux_reconciliation_togger_icon ux_tab_style'}" onclick="reconciliationDatatable.onRowToggle(this, reconcileTable);">
<p:rowToggler/>
</div>
</h:panelGroup>
<h:outputText styleClass="ux_column_data_text ux_normal_text ux_reconciliation_subcriber" rendered="#{reconciliationDetail.payorName != null}" value="#{reconciliationDetail.payorName}"/>
</p:column>