getDescendantCount (NotesXspViewEntry - JavaScript)

Read-only. The number of descendants belonging to the current view entry.

Defined in

NotesXspViewEntry (JavaScript)

Syntax

getDescendantCount() : int
Return value Description
int The descendant count for the column.

Examples

This data binding script for a Multiline Edit Box is embedded in a Repeat control with a Domino® view data source whose collection name is rowdata. The script gets information about each view row.
try {
	return rowdata.getPosition(",").toString() +
	"   indent level = " + rowdata.getIndentLevel().toFixed() +
	"   column indent level = " + rowdata.getColumnIndentLevel().toFixed() +
	"   sibling count = " + rowdata.getSiblingCount().toFixed() +
	"   child count = " + rowdata.getChildCount().toFixed() +
	"   descendant count = " + rowdata.getDescendantCount().toFixed() +
	"\n"
} catch (e) {
	return e.toString();
}
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>