View Full Version : Associate each leaf of a tree panel to a separate model instance
6 Aug 2012, 3:35 PM
For a tree.panel, can you associate each leaf with a model instance from a store? So for example, you had a tree of users and each user represents a model instance. If you remove a user leaf in the tree, you could easily remove it's associated model instance as well. Basically a way to fuse a model instance to a node instance in a tree.
8 Aug 2012, 7:43 PM
Sounds like voodoo to me .. but you never know ... Perhaps someone may ;)
Each node in the tree is a model. It gets decorated with NodeInterface to behave like a node, but it's a model instance.
8 Aug 2012, 8:05 PM
I hate when I misunderstand the question .. in a forum, in public .. :">
9 Aug 2012, 12:23 PM
1. How do I get to the model thats decorated? For example...
2. Can I specify the model? For example
text: 'my leaf',
The node ~is a~ model. It has all the model methods.
9 Aug 2012, 7:00 PM
I took a crack at it and even though my code runs, I don't know if it worked or not. What do I access in the node to know if my custom model made it?
Do I just do a node.getModel.getFields() and estTime, allocTime etc etc will show up? I looked at the object that gets dumped to the console and tried to understand as much of the source from the docs.
fields: ['id', 'name', 'estTime', 'allocTime','desc', 'dueDate']
text: 'All Books',
text: "Book 1",
text: "book 2",
16 Aug 2012, 5:02 PM
I just wanted to say thanks. I made a sample app and after some firebugging, I know what you meant. Sorry, I must have had a brain fart.
Powered by vBulletin® Version 4.2.3 Copyright © 2017 vBulletin Solutions, Inc. All rights reserved.