toggleExpanded (NotesXspViewEntry - JavaScript™)
Expands or collapses child entries to the opposite state.
Defined in
NotesXspViewEntry (JavaScript)Syntax
toggleExpanded() : void
Usage
Examples
This is the XML for a Button control embedded in a Data Table control with a Domino® view data source whose collection name isrowdata
. 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>