resortView (NotesView - JavaScript™)
Resorts a view.
Defined in
NotesViewSyntax
resortView() : void
Parameter | Description |
---|---|
columnName |
The name of a column in the view. Defaults to the first column. |
ascendingFlag |
True for an ascending sort; false for descending. Defaults to ascending. |
Usage
The first method is specified to resort ascending on the first column, but may not work. Best practice is to use the second method.An exception occurs if the column cannot be resorted.
Examples
This table (complete XML shown) contains two buttons for resorting a view associated with the page.<xp:table>
<xp:tr>
<xp:td>
<xp:label value="Ascending" id="label1"></xp:label></xp:td>
<xp:td>
<xp:button id="button1">
<xp:eventHandler event="onclick" submit="true"
refreshMode="complete">
<xp:this.action><![CDATA[#{javascript:
try {
view3.resortView("subject", true);
} catch(e) {
requestScope.status = "Column not resortable";
}
}]]></xp:this.action>
</xp:eventHandler></xp:button></xp:td>
</xp:tr>
<xp:tr>
<xp:td>
<xp:label value="Descending" id="label2"></xp:label></xp:td>
<xp:td>
<xp:button id="button3">
<xp:eventHandler event="onclick" submit="true"
refreshMode="complete">
<xp:this.action><![CDATA[#{javascript:
try {
view3.resortView("subject", false);
} catch(e) {
requestScope.status = "Column not resortable";
}
}]]></xp:this.action>
</xp:eventHandler></xp:button></xp:td>
</xp:tr>
</xp:table>