-
25 Jun 2012 10:22 AM #1
[4.1.1 rc2] TreePanel/TreeStore: returning false from beforeload causes issues
[4.1.1 rc2] TreePanel/TreeStore: returning false from beforeload causes issues
REQUIRED INFORMATION
Ext version tested:- Ext 4.1.1 rc2
- Any
- The initial requirement is preveting a node expanding on some condition. I have tried to return false from "beforeitemexpand", it doesn't work well. Then I have noticed this behavior is not documented. I mean the behavior on returning false. Is there a lack in the docs or, really, there is no such feature?
- Then I have tried to return false from the beforeload listener and have faced three issues:
- The loading icon doesn't dissappear.
- All nodes become not expandable. It doesn't happen due to returning false for the beforeload, because:
- The beforeload event appears to be not fired anymore.
- Since the returning false feature from the beforeload listener is documented, I would consider the issues above a bug.
- The same happens for both - tree and treestore - beforeload events.
- Is there any other way to optionally prevent expanding? For a static tree as well, because beforeload looks to be not an option for a static tree.
- Run the page
- Expand the "Node1".
- Try to expand other nodes.
- The nodes are not expandable due to returning false from the beforeload listener.
- The loading icon should disappear or even just not shown.
- When I try to expand the first node - it's not expanded. Good.
- Its loading icon is shown. Bad.
- All nodes become not expandable. It doesn't happen due to returning false for the beforeload, because the beforeload listener is not fired anymore.
- The example does not require a working URL for AJAX proxy to reproduce the issues.
Code:<html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>TreePanel/TreeStore BeforeLoad Bug</title> <link type="text/css" rel="stylesheet" href="../resources/css/ext-all.css" /> <script type="text/javascript" src="../ext-all.js"></script> <script type="text/javascript"> Ext.onReady(function () { Ext.create("Ext.tree.Panel", { renderTo: Ext.getBody(), height: 300, width: 300, store: { type: "tree", proxy: { type: "ajax", url: "/Test/GetNodes" }, listeners: { beforeload: { fn: function (store, operation) { console.log("beforeload"); return false; } } } }, root: { expanded: true, text: "Root", children: [{ text: "Node1" }, { text: "Node2" }, { text: "Node3" }] } }); }); </script> </head> <body> </body> </html>
HELPFUL INFORMATION
Debugging already done:- Apologize, no time for now.
- Calling hides the loading icon. But, I think, it should not be done manually. Anyways, the beforeload event stays to be not fireable.Code:
operation.node.set('loading', false);
-
27 Jun 2012 7:12 AM #2Sencha - Senior Forum Manager
- Join Date
- Mar 2007
- Location
- St. Louis, MO
- Posts
- 33,624
- Vote Rating
- 435
Thanks for the report.
Mitchell Simoens @SenchaMitch
Sencha Inc, Senior Forum Manager
________________
http://www.JSONPLint.com - Source to lint your JSONP!
Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
https://github.com/mitchellsimoens
Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/
Need more help with your app? Hire Sencha Services services@sencha.com
Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is almost in print!
When posting code, please use BBCode's CODE tags.
-
19 Oct 2012 11:18 AM #3
-
27 Dec 2012 1:40 AM #4
Success! Looks like we've fixed this one. According to our records the fix was applied for
EXTJSIV-6656
in
4.1.4.


Reply With Quote