Opened 9 years ago
Closed 9 years ago
#14657 closed defect (wontfix)
dojox.grid steals focus when it gets updated
Reported by: | cc | Owned by: | Evan |
---|---|---|---|
Priority: | low | Milestone: | 1.8 |
Component: | DojoX Grid | Version: | 1.7.1 |
Keywords: | Cc: | ||
Blocked By: | Blocking: |
Description
I have a dojox.grid and a textbox on the same page. A background service updates the dojox.grid by adding, removing and editing items. There is an scenario where the grid will steal focus from other controls unexpectedly.
1) Load a page that contains a dojox.grid and a textbox.
2) Click on a header in the grid to sort by a column.
3) Focus on the textbox.
4) Something updates the grid (adds an item, for example).
5) Textbox loses focus, interrupting the user from typing into it.
The following is a temporary fix that I use to prevent this from happening:
dojox.grid._FocusManager.prototype._delayedHeaderFocus = function(){ if(this.isNavHeader()){ this.focusHeader(); //this.grid.domNode.focus(); } }
Change History (7)
comment:1 Changed 9 years ago by
comment:2 Changed 9 years ago by
Component: | General → DojoX Grid |
---|---|
Owner: | set to Evan |
Priority: | high → undecided |
comment:3 Changed 9 years ago by
Not sure why it's put there since it's has been there for a long time. But putting "this.grid.domNode.focus()" in "_delayedHeaderFocus()" is weird as the purpose is to focusing header rather grid.body. After a through test, removing that line is safe.
But I'm not sure why removing that line fixes your issue, as Grid is still putting focus on its header when refreshed/re-rendered.
comment:5 Changed 9 years ago by
Milestone: | tbd → 1.8 |
---|---|
Priority: | undecided → low |
comment:7 Changed 9 years ago by
Resolution: | → wontfix |
---|---|
Status: | reopened → closed |
This issue won't be 100% fixed without significant changes to Grid focusing logic - Grid will try to focus its header or cell body each time it's refreshed or new pages of rows are rendered. E.g. invoking
grid.scrollToRow(xxx) grid.setStore()/setStructure() ... many more ways
will all result to this issue, considering the concentrated efforts on dgrid and gridx, closing this as won't fix
Should have said dojox.grid.DataGrid? to be precise.