XULTreeViewRecord.reSort Member

this method will cause all child records to be reSorted. any records with the default sortCompare method will be sorted by the colID passed to setSortColumn.

Syntax

object.reSort(leafSort);

Arguments

ArgumentSummary
leafSort

Returns

Remarks

the local parameter is used internally to control whether or not the  sorted rows are invalidated.  don't use it yourself.

See Also

Source Code

function xtvr_resort (leafSort)
{
if (!("childData" in this) || this.childData.length < 1 ||
(this.childData[0].sortCompare == xtvr_sortcmp &&
!("sortColumn" in this._share) || this._share.sortDirection == 0))
{
/* if we have no children, or we have the default sort compare and no
* sort flags, then just exit */
return;
}
this.childData.sort(this.childData[0].sortCompare);
for (var i = 0; i < this.childData.length; ++i)
{
if ("isContainerOpen" in this.childData[i] &&
this.childData[i].isContainerOpen)
this.childData[i].reSort(true);
else
this.childData[i].sortIsInvalid = true;
}
if (!leafSort)
{
this.invalidateCache();
var tree = this.findContainerTree();
if (tree && tree.tree)
{
var rowIndex = this.calculateVisualRow();
/*
dd ("invalidating " + rowIndex + " - " +
(rowIndex + this.visualFootprint - 1));
*/
tree.tree.invalidateRange (rowIndex,
rowIndex + this.visualFootprint - 1);
}
}
delete this.sortIsInvalid;
}