isExpanded setExpanded (NotesXspViewEntry - JavaScript)

Indicates whether child entries are expanded.

Defined in

NotesXspViewEntry (JavaScript)

Syntax

isExpanded() : boolean

setExpanded(boolean) : void

Return value and parameter Description
boolean true if the entry is expanded; false otherwise

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>
This example is the same as the first but exercises setExpanded.
<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:if (rowdata.isExpanded()) {
			rowdata.setExpanded(false)
		} else {
			rowdata.setExpanded(true)
		}}]]></xp:this.action>
	</xp:eventHandler>
</xp:button>