-
17 Sep 2010 4:11 AM #1
TreeGrid Loader hasChildren() 2.2.0
TreeGrid Loader hasChildren() 2.2.0
Hi,
I use an assync TreeGrid and it used to work perfectly before the 2.2.0 version.
I overrided the TreeLoader.hasChilren() to decide if some node is leaf or not independently of it has children or not in the database, so far so good.
In the 2.2.0 version, this behavior is not been assumed anymore. After the node gets the "loaded" state and if this node doesn't have any child, it is considered leaf, independent of the Loader.hasChildren() logic. You can reproduce this by collapsing the parent folder and expanding it again.
Checking the differences between the 2 versions, I could find the possible reason. The TreeNode constructor had its behavior changed.
Version 2.1.1
Version 2.2.0Code:public TreeNode(String id, M m) { this.id = id; this.m = m; if (loader != null && !loaded) { leaf = !loader.hasChildren(m); } }
As you can see, the leaf boolean property is not been loaded anymore. Is it really correct? If yes, how should I work around it if I don' t want ext decides if some node of mine is leaf or not?Code:public TreeNode(String id, M m) { this.id = id; this.m = m; }Last edited by marcio.mnz; 17 Sep 2010 at 4:16 AM. Reason: make it more clear
-
20 Sep 2010 5:54 AM #2
Answer from the support team:
"TreeGrid was changed to be exactly the same than TreePanel. The loader gets only asked if the node is not loaded. You will also need to override the TreeGrid hasChildren method."
Similar Threads
-
When do call method 'public boolean hasChildren' ?
By yh800701 in forum Ext GWT: DiscussionReplies: 1Last Post: 8 Apr 2010, 12:08 AM -
Expand a treegrid node doesn't show the good value in the cells, bug in treegrid ?
By Nico33 in forum Ext GWT: DiscussionReplies: 8Last Post: 24 Feb 2010, 11:55 PM -
TreeGrid - Loader question
By sbuemaint in forum Ext 3.x: Help & DiscussionReplies: 1Last Post: 27 Jan 2010, 3:16 PM -
[CLOSED] [GXT 2.0.1] TreeGrid to TreeGrid Demo - Parent folder changes to child icon
By cpopp in forum Ext GWT: Bugs (2.x)Replies: 1Last Post: 26 Aug 2009, 10:54 AM -
[r1181] Auto-loading TreeBinder does not honor TreeLoader.hasChildren()
By negge in forum Ext GWT: Bugs (1.x)Replies: 1Last Post: 20 Jan 2009, 6:42 PM


Reply With Quote