toggleExpanded (NotesXspViewEntry - JavaScript)

Expands or collapses child entries to the opposite state.

Defined in

NotesXspViewEntry (JavaScript)

Syntax

toggleExpanded() : void

Usage

In a Data Table control, you can collapse and expand child rows with these methods.

Examples

This is the XML for a Button control embedded in a Data Table control with a Domino® view data source whose collection name is rowdata. The button has a script to hide it if the row has no descendants. Another script sets the button label to Expand??? or Collapse??? depending on the state of the current row. Finally the onclick event for the button toggles the state of the current row.
<xp:button id="button1">
	<xp:this.rendered><![CDATA[#{javascript:rowdata.getDescendantCount() > 0}]]></xp:this.rendered>
	<xp:this.value><![CDATA[#{javascript:if (rowdata.isExpanded()) {
		return "Collapse"
	} else {
		return "Expand"
	}}]]></xp:this.value>
	<xp:eventHandler event="onclick" submit="true"
		refreshMode="complete">
		<xp:this.action><![CDATA[#{javascript:rowdata.toggleExpanded()}]]></xp:this.action>
	</xp:eventHandler>
</xp:button>