[Dojo-checkins] [dojo] #9339: Tree: we need public functions to access a node from an item

dojo trac at dojotoolkit.org
Thu Jun 11 05:09:43 EDT 2009


#9339: Tree: we need public functions to access a node from an item
-----------------------------------------+----------------------------------
 Reporter:  quenenni                     |        Owner:       
     Type:  enhancement                  |       Status:  new  
 Priority:  normal                       |    Milestone:  1.4  
Component:  Dijit                        |      Version:  1.3.0
 Severity:  normal                       |   Resolution:       
 Keywords:  tree item node _itemNodeMap  |  
-----------------------------------------+----------------------------------

Comment(by alle):

 With #9631 there can be more than one node related to the same item so a
 read method ( getNodesByItem(<item>) ) have to return an array of
 nodes.[[BR]]
 That's not a problem but having different path in tree to different nodes
 related to same item can make selection persistence on tree reload a bit
 difficult. Same for some sort of tree selection syncing.[[BR]]
 There's a bigger problem when items and nodes are lazy-loaded so
 _itemsNodeMap change on tree reload and can change without store changes
 (so without notification too).[[BR]]
 Ex: we can try set old selection but there's no node related to that item
 because it will be a child node of a closed node that hasn't jet loaded
 its children.

 I think a better way to get/set selection based on item that support tree-
 reload and tree-selection-syncing is getting/setting full tree selection
 path mapped to related items. Creating an attr named "ItemSelectionPath"
 or something prettier which is an array of items starting from root item
 and ending to item related to selected node.[[BR]]
 This way a tree can load not already loaded children as needed (no lazy-
 loading problem on tree reload) and there's no problem about selecting
 right node too.

 AFAIKS the only remaining problem of the above solution is resetting
 perfect node selection when an item is child of an other more than once
 because we don't know which children related to same item select using
 ItemSelectionPath only.

-- 
Ticket URL: <http://trac.dojotoolkit.org/ticket/9339#comment:5>
dojo <http://dojotoolkit.org/>
The Dojo UI Toolkit


More information about the Dojo-checkins mailing list