Opened 14 years ago
Closed 14 years ago
#5912 closed enhancement (duplicate)
[patch][ccla] Allow Tree to use custom TreeNode implementations
Reported by: | Robert Coup | Owned by: | |
---|---|---|---|
Priority: | high | Milestone: | 1.2 |
Component: | Dijit | Version: | 1.0 |
Keywords: | tree | Cc: | bill |
Blocked By: | Blocking: |
Description
Currently if you want to make your nodes more complicated than adjusting the CSS or text label it requires monkey-patching dijit._TreeNode
.
The attached patch adds a nodeType
parameter to dijit.Tree
which takes a constructor function (or string that can be resolved), which is used for constructing nodes in that tree. A simple test is there as well. The constructor function needs to be compatible with dijit._TreeNode
obviously. But it allows easy behavior changes, using different templates, storing more state, etc.
Submitting for review, since I'm not a Tree expert. I'm also not sure about the nodeType
name, feel free to offer improvements.
Attachments (2)
Change History (4)
Changed 14 years ago by
Attachment: | tree_custom_nodetype.0.patch added |
---|
comment:1 Changed 14 years ago by
Cc: | bill added |
---|
Changed 14 years ago by
Attachment: | tree_custom_nodetype.1.patch added |
---|
comment:2 Changed 14 years ago by
Resolution: | → duplicate |
---|---|
Status: | new → closed |
Heh, I'm never sure what to name things myself either. See #5719 which is a dup of this one.
minor formatting/style improvements