> Sounds good to me. One improvement could be to only create two context 
> menu instances (one for files and one for folders) and assign them to 
> the tree items as needed. From within the menu, you can access the 
> "opener" widget (the tree item that was right-clicked) and then get the 
> model object from that so there's no need to create a unique menu for 
> each item. Reusing existing widgets is generally preferable to creating 
> new ones in terms of performance.

That's a good idea! Thanks.

> I think that's what you'll have to do. Traverse the tree's items, check 
> if the model item is the one you want, then recursively call getParent() 
> and open each folder until you hit the root.

Good to know I'm on the right path.

Daniel, you are a core developer right? I found something that might be a
bug, or intended behavior. How do I go about to find out which it is?
The issue is that if you call setParent() on a treeItem that is inside a
closed treeFolder it isn't updated. The workaround I'm using now is to open
the treeFolder then call setParent.
I was looking through the code, thought I might give a pull request on
Github and let you take a stand on if it's a bug or intended behavior. But
the code seems to be a regular property, so I didn't know how to fix it.

Oups, got a little bit of topic here, but I found it when I was implementing
the feature to select the right treeItem, so better to ask.

Regards,
Fredrik



--
View this message in context: 
http://qooxdoo.678.n2.nabble.com/Using-model-data-in-tree-to-create-context-menu-etc-tp7584277p7584301.html
Sent from the qooxdoo mailing list archive at Nabble.com.

------------------------------------------------------------------------------
Get 100% visibility into Java/.NET code with AppDynamics Lite!
It's a free troubleshooting tool designed for production.
Get down to code-level detail for bottlenecks, with <2% overhead. 
Download for free and get started troubleshooting in minutes. 
http://pubads.g.doubleclick.net/gampad/clk?id=48897031&iu=/4140/ostg.clktrk
_______________________________________________
qooxdoo-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel

Reply via email to