Opened 13 years ago

Closed 13 years ago

#9443 closed enhancement (fixed)

Tree: method to get/set currently selected item in tree

Reported by: bill Owned by:
Priority: high Milestone: 1.4
Component: Dijit Version: 1.3.0
Keywords: Cc:
Blocked By: Blocking:


Tree should have a way to get/set the currently selected item. Since Tree has no way of knowing the ancestors of an item, and also since items can have multiple parents, this really amounts to getting/setting the path to the currently selected item.

This is from a patch in #9339 but it deserves it's own ticket.

Change History (1)

comment:1 Changed 13 years ago by bill

Resolution: fixed
Status: newclosed

(In [18379]) Tree enhancements:

  • path attribute to set/get the currently selected item in the tree (ex: ["Foods", "Fruit", "Apple"])
  • selectedItem attribute to get/set the currently selected item in the tree. Can only set currently selected item if that item is currently visible (ie, already downloaded from the model) and there's only one TreeNode? matching that item (ie, it's not multi-parented)
  • getNodesByItem() method to get list of TreeNodes matching a given item or item id.

Thanks to Alessandro Ferrari (alle) (CLA on file) for the great patch!

Fixes #9443, #9339 !strict.

Note: See TracTickets for help on using tickets.