XULTreeView.onRouteKeyPress Member

Internal.

Syntax

object.onRouteKeyPress(event);

Arguments

ArgumentSummary
event

Returns

Remarks

See Also

Source Code

function xtv_rkeypress (event)
{
var rec;
var rowIndex;
if ("onRowCommand" in this && (event.keyCode == 13 || event.charCode == 32))
{
if (!this.selection)
return;
rowIndex = this.tree.view.selection.currentIndex;
if (rowIndex == -1 || rowIndex > this.rowCount)
return;
rec = this.childData.locateChildByVisualRow(rowIndex);
if (!rec)
{
ASSERT (0, "bogus row index " + rowIndex);
return;
}
this.onRowCommand(rec, event);
}
else if ("onKeyPress" in this)
{
rowIndex = this.tree.view.selection.currentIndex;
if (rowIndex != -1 && rowIndex < this.rowCount)
{
rec = this.childData.locateChildByVisualRow(rowIndex);
if (!rec)
{
ASSERT (0, "bogus row index " + rowIndex);
return;
}
}
else
{
rec = null;
}
this.onKeyPress(rec, event);
}
}