Skip to content

Commit

Permalink
Adding focus movement to tables with multiply selection
Browse files Browse the repository at this point in the history
  • Loading branch information
Dmytry Kashcheiev committed Feb 13, 2014
1 parent 3d4dd92 commit 4e9d203
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions openFaces/source/META-INF/resources/openfaces/table/table.js
Expand Up @@ -856,6 +856,32 @@ O$.Table = {
if (newIdx != null) {
passEvent = false;
this.__setSelectedRowIndexes([newIdx]);
///////////////////////////////////////////////////
if (O$._activeElement.nodeName == "INPUT") {
var needElement = O$._activeElement;
var isNeedNode = true;
var needColumn = null;
var needChildrenNodes = null;
while (isNeedNode) {
needElement = needElement.parentNode;
if (needElement.nodeName == "TD") {
if (needElement._column._table == this) {
needColumn = needElement.cellIndex;
needElement = needElement.parentNode.parentNode;
needChildrenNodes = needElement.childNodes;
needElement = needChildrenNodes[newIdx];
needChildrenNodes = needElement.childNodes
needElement = needChildrenNodes[needColumn];
needElement = O$.getFirstFocusableControl(needElement);
needElement.focus();
isNeedNode = false;
}
}
}


}
///////////////////////////////////////////////////////
O$.Table._scrollToRowIndexes(this, [newIdx]);
this._baseRowIndex = null;
this._baseSelectedRowIndexes = null;
Expand Down

0 comments on commit 4e9d203

Please sign in to comment.