Opened 13 years ago
Closed 13 years ago
#6238 closed defect (fixed)
Tree: "'item' has no properties" message in dndSelector.js
Reported by: | guest | Owned by: | bill |
---|---|---|---|
Priority: | high | Milestone: | 1.2 |
Component: | Dijit | Version: | 1.0 |
Keywords: | dndSelector tree | Cc: | dante |
Blocked By: | Blocking: |
Description (last modified by )
It seems that the following code in dijit.tree.dndSelector causes an error when a tree is rootless (at least that's my guess)....
onMouseDown: function(e){ // summary: event processor for onmousedown // e: Event: mouse event if(!this.current){ return; } var item = dijit.getEnclosingWidget(this.current).item this.tree.model.getIdentity(item);
When I expand a node in the top-level of the tree, the item variable is undefined in the code above, leading to the error message "'item' has no properties".
Changing the code to...
var id = (item ? this.tree.model.getIdentity(item) : "root");
...seems to temporarily fix the problem for me, but I don't understand the code well enough to know if this is a valid fix.
Change History (7)
comment:1 Changed 13 years ago by
comment:2 Changed 13 years ago by
Milestone: | 1.1 → 1.2 |
---|
comment:3 Changed 13 years ago by
Owner: | set to bill |
---|---|
Summary: | "'item' has no properties" message in dndSelector.js → Tree: "'item' has no properties" message in dndSelector.js |
comment:4 Changed 13 years ago by
Cc: | dante added |
---|---|
Description: | modified (diff) |
bill are you working on this? the _tree/test_TreeDnD is horribly broken in trunk, and I'm looking into some stuff ... would like to coordinate.
comment:5 Changed 13 years ago by
Description: | modified (diff) |
---|
Haven't started working on it but I was planning to look at tree bugs over the next few days. I'll wait for you to do your stuff first though. As I wrote in the comment above I need a test case before working on this (ie, instructions on how to reproduce).
comment:6 Changed 13 years ago by
Status: | new → assigned |
---|
Peter reproduced this or a similar error in test_Tree.html by dropping to the left of the TreeNode (but still within the tree). Since the mouse isn't over a TreeNode we run into problems. Actually, the drop icon should be red in that case, but it's green.
comment:7 Changed 13 years ago by
Resolution: | → fixed |
---|---|
Status: | assigned → closed |
(In [13801]) Disable dropping onto the Tree itself rather than onto a particular TreeNode? within the tree. Some of the current code assumes that all drops are onto TreeNodes? (thus causing "item not defined" errors when that isn't true), and also, allowing drops onto the Tree itself is error prone since a user may drop to the left of a TreeNode? thinking that they are dropping onto the TreeNode? itself (but they aren't). At some point should implement dropping between nodes so that we can support adding top level items to a rootless tree. Fixes #6238. !strict
What did you do trigger this error to occur? Can you attach a test case? Thx.