I have an Ext.tree.Panel, which I want to configure like so:
Code:
Ext.define('myTest.CoolTree', {
    extend:'Ext.tree.Panel',
    alias:'widget.coolTree',
    store:'coolTreeStore',
    rootVisible:true,
    root: {
        text: 'All',
        expanded: true
    }
});
If I do this, it completely ignores my root config, and uses the default (text=Root, expanded=false). It appears this is because the initComponent function for Ext.tree.Panel has a 3-part conditional whose first if is overly broad:

Code:
Ext.define('Ext.tree.Panel', {
...
    initComponent: function() {
...
         if (Ext.isString(me.store)) {
             me.store = Ext.StoreMgr.lookup(me.store);
         } else if (!me.store || Ext.isObject(me.store) && !me.store.isStore) {
              me.store = new Ext.data.TreeStore(Ext.apply({}, me.store || {}, {
                  root: me.root,
                  fields: me.fields,
                  model: me.model,
                  folderSort: me.folderSort
              }));
        } else if (me.root) {
              me.store = Ext.data.StoreManager.lookup(me.store);
              me.store.setRootNode(me.root);
             if (me.folderSort !== undefined) {
                   me.store.folderSort = me.folderSort;
                   me.store.sort();
              }
        }
...
My string is a store, so the first case hits, and that case ignores root. Is that intentional? For my use, I want to hit the last else-if, where it treats my store as a string (it is) and respects my root config.

My workaround is to override initcomponent, call parent, and then:

Code:
        me.setRootNode({text:'All', expanded:true});
I'd definitely prefer to not do that. Thoughts?