Opened 12 years ago

Closed 11 years ago

Last modified 10 years ago

#10504 closed defect (duplicate)

[patch][cla] Grid: Focus manager throws exception when updating structure

Reported by: avoidscorn Owned by: Bryan Forbes
Priority: high Milestone: tbd
Component: DojoX Grid Version: 1.4.0
Keywords: Cc: Evan
Blocked By: Blocking:


In certain situations, dojox.grid._FocusManager keeps a reference to a destroyed view, causing it to throw an exception when it tries to focus the view's header nodes.

The following steps reproduce this bug:

  1. Ensure that the grid has enough rows to require a scrollbar. This ensures that the focus manager's focusView attribute is set.
  2. Change the grid's query such that the grid no longer needs a scrollbar. This is necessary to ensure that dojox.grid._ViewManager.getFirstScrollingView returns null.
  3. Set the grid's structure attribute (it does not matter what the new structure is). Due to the logic in dojox.grid._FocusManager.initFocusView, the focusView attribute will still reference the old, destroyed view, because there is no other scrolling view to use instead.
  4. The focus manager causes a "node is undefined" exception to be thrown in its _isHeaderHidden method, because its view's headerNode is undefined at this point.

The attached patch changes initFocusView to check if its existing focusView is destroyed before reusing it. I'm not sure if this is the best place to handle it, but it works for me.

Attachments (1)

patch.txt (596 bytes) - added by avoidscorn 12 years ago.

Download all attachments as: .zip

Change History (7)

Changed 12 years ago by avoidscorn

Attachment: patch.txt added

comment:1 Changed 12 years ago by Nathan Toone

Owner: Nathan Toone deleted

Unassigning my tickets.

comment:2 Changed 11 years ago by Stefan Bird

This ticket no longer has an owner - can this patch be committed?

The problem fixed is still present in 1.5.

comment:3 Changed 11 years ago by dante

Cc: evan added
Owner: set to bryanforbes

bryan/evan, can you take a look at this?

comment:4 Changed 11 years ago by bill

Owner: changed from bryanforbes to Bryan Forbes

comment:5 Changed 11 years ago by evan

Resolution: duplicate
Status: newclosed

duplicate with #11280, already fixed with [23618]

comment:6 Changed 10 years ago by Evan

Cc: Evan added; evan removed
Note: See TracTickets for help on using tickets.