3 Apr 2007 1:52 PM #1
TreeNode states need improvement
TreeNode objects can currently either be a folder or a leaf. Unfortunately this isn't quite right. If one tags a node as a leaf the library believes that it's unable to have children (it's neutered!) Tagging it as a folder always applies an expand elbow graphic to it, which has no effect if it's the end of the tree.
Why would you want to have a folder be at the end of the tree? There's no reason for them not to be. Folders are containers. As such, there's no reason they shouldn't be able to be at the end of the tree. But they are not leaves. While it doesn't actually break drag and drop, the visual presentation is such that it just looks wrong because they have expanders that don't do anything.
Somehow this needs to get worked out. I propose somehow exposing hasChildren to the underlying expansion mechanism to determine whether or not a node marked as a folder actually has children, and only then show the expander + item.
3 Apr 2007 5:00 PM #2
I take it this is with an AsyncTreeNode? My question would be, how can it know that there are no children without making a request or you providing the information? And how can it trigger that request without a + icon or preset expansion?
There is a workaround available that does the behavior you want. There a thread in the beta detailing how to do it. I can look it up for you if you want. It's very simple and I am using it myself in the bug tracker. It consists of passing an empty children array (it has no children) and expanded:true (to kill the expansion indicator). It results in no additional server requests.Jack Slocum
Sencha Co-Founder, Ext JS Founder
Original author of Ext JS 1, 2 & 3.
4 Apr 2007 9:49 AM #3Jeff Howden
Ext JS - Support Team Volunteer
Any and all code samples that are authored by me and posted on the Ext forums or website are hereby released into the public domain and I release anyone or entity of liability by using said code samples unless explicitly stated otherwise.
Opinions are mine and not necessarily endorsed by Ext, LLC. Please do not contact me directly for assistance unless requested by me.