Opened 12 years ago

Closed 12 years ago

#5240 closed defect (invalid)

Adding items to tree fails in weird ways

Reported by: guest Owned by:
Priority: high Milestone:
Component: Dijit Version: 1.0
Keywords: Cc:
Blocked By: Blocking:

Description

In _onNewItem() the 'parent' variable is declared locally inside a block and used outside of it, causing all sort of issues when changing contents of trees.

This is on version 1.0.1 (not present in the ticket version list)

After applying the fix below, the behavior is back as before

Change:

if(parentInfo){

var parent = this._itemNodeMap[this.getItemParentIdentity(item, parentInfo)];

To:

var parent = null;

if(parentInfo){

parent = this._itemNodeMap[this.getItemParentIdentity(item, parentInfo)];

Change History (3)

comment:1 Changed 12 years ago by guest

Looking in svn, it seems that this code is here since a long time. I have no idea why it started breaking at the 1.0 (or 0.9+?) to 1.0.1 upgrade (no change made to my code).

This is with Firefox2, Mac OS X

comment:2 Changed 12 years ago by guest

Please mark bug as INVALID:

1) var scope in javascript make the two code snippets equivalent

2) the "fix" was not due to that code change, but due to the fact I relaunched FireFox? after the fix (the error was a transient error due to FireFox?)

comment:3 Changed 12 years ago by tk

Resolution: invalid
Status: newclosed

marking as requested

Note: See TracTickets for help on using tickets.