18 Mar 2013 8:32 AM #1
TreePanel with "rootVisible: false" not showing anything in Ext 4.2
Ext version tested:
- Ext 4.2.0
- Chrome Version 25.0.1364.172 m
I can't get the treepanel working in the new Ext 4.2.0 version. Specifically when I don't want the root to be visible. I provide 2 test cases.
Steps to reproduce the problem:
- define, create and load an 'Ext.data.TreeStore',
- create a treepanel with the rootVisible set to false.
- list of folders (optionally leafs, but not in my test data)
- no list empty, 0 height panel showing.
working Ext 4.1.1 example:
broken Ext 4.2.0 example:
See this URL for live test case:http://jsfiddle.net/Vandeplas/y9WhL/16/
Additional CSS used:
- only default ext-all-debug.css
- Windows 7 - 64Bit
18 Mar 2013 1:01 PM #2
- Join Date
- Mar 2007
- Gainesville, FL
- Vote Rating
It looks like it's the leaf field that you have in your model.
Sencha Inc, Senior Software Engineer
Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
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 email@example.com
Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is in print!
When posting code, please use BBCode's CODE tags.
19 Mar 2013 12:32 AM #3
Thanks for putting me on the right track!
The issue was indeed with the converter on the leaf field. Behind the scenes Ext creates a root node if no root node is present. In previous versions the newly created root node wasn't passed through the converter in Ext 4.2 it is past through the converter. In my case I checked if type is 'folder'. But the root field has no type resulting in being a leaf. Resulting in not showing anything. (because the root was hidden)
working fiddle with logging