Permalink
Browse files

Adding focus movement to tables with multiply selection

  • Loading branch information...
1 parent 3d4dd92 commit 4e9d2032a273d11702f2e0a0cfe68228e3c0fdb4 Dmytry Kashcheiev committed Feb 13, 2014
Showing with 26 additions and 0 deletions.
  1. +26 −0 openFaces/source/META-INF/resources/openfaces/table/table.js
@@ -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;

0 comments on commit 4e9d203

Please sign in to comment.