Success! Looks like we've fixed this one. According to our records the fix was applied for EXTJS-8260 in 4.2.0.663.
  1. #1
    Sencha - Community Support Team mankz's Avatar
    Join Date
    Nov 2007
    Location
    Stockholm, Sweden
    Posts
    2,804
    Vote Rating
    133
    mankz is a splendid one to behold mankz is a splendid one to behold mankz is a splendid one to behold mankz is a splendid one to behold mankz is a splendid one to behold mankz is a splendid one to behold

      1  

    Default [4.2.0.265] Tree Panel inconsitency

    [4.2.0.265] Tree Panel inconsitency


    TreeStore loading is different if tree column is locked or not. Try the code below, nothing happens - nothing is rendered as the store is not loaded. Set the column as 'locked' and it loads...

    Code:
    Ext.onReady(function() {
        Ext.define('Task', {
            extend: 'Ext.data.Model',
            fields: [
                {name: 'task',     type: 'string'},
                {name: 'user',     type: 'string'},
                {name: 'duration', type: 'string'},
                {name: 'done',     type: 'boolean'}
            ]
        });
    
        var taskStore = Ext.create("Ext.data.TreeStore", {
            model : 'Task',
            proxy : {
                type : 'ajax',
                url: 'tasks.js'
            }
        });
    
        var g = Ext.create("Ext.tree.Panel", {
            title: 'Core Team Projects',
            width: 500,
            height: 300,
            renderTo: Ext.getBody(),
            store: taskStore,
            columns: [
                {
                    xtype: 'treecolumn', //this is so we know which column will show the tree
                    text: 'Task',
                    width: 200,
                    sortable: true,
                    dataIndex: 'task'
                }
            ]
        });
    });

  2. #2
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    37,642
    Vote Rating
    899
    mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute

      0  

    Default


    Thanks for the report! I have opened a bug in our bug tracker.

  3. #3
    Sencha - Ext JS Dev Team Animal's Avatar
    Join Date
    Mar 2007
    Location
    Notts/Redwood City
    Posts
    30,545
    Vote Rating
    64
    Animal is a jewel in the rough Animal is a jewel in the rough Animal is a jewel in the rough

      0  

    Default


    The following code should restore normal behaviour:

    Override Ext.tree.Panel

    Code:
        initComponent: function() {
            var me = this,
                cls = [me.treeCls],
                store = me.store,
                view;
    
            if (me.useArrows) {
                cls.push(me.arrowCls);
                me.lines = false;
            }
    
            if (me.lines) {
                cls.push(me.linesCls);
            } else if (!me.useArrows) {
                cls.push(me.noLinesCls);
            }
    
            if (Ext.isString(store)) {
                store = me.store = Ext.StoreMgr.lookup(store);
            } else if (!store || Ext.isObject(store) && !store.isStore) {
                store = me.store = new Ext.data.TreeStore(Ext.apply({
                    root: me.root,
                    fields: me.fields,
                    model: me.model,
                    folderSort: me.folderSort
                }, store));
            } else if (me.root) {
                store = me.store = Ext.data.StoreManager.lookup(store);
                store.setRootNode(me.root);
                if (me.folderSort !== undefined) {
                    store.folderSort = me.folderSort;
                    store.sort();
                }
            }
    
            // I'm not sure if we want to this. It might be confusing
            // if (me.initialConfig.rootVisible === undefined && !me.getRootNode()) {
            //     me.rootVisible = false;
            // }
    
            me.viewConfig = Ext.apply({
                rootVisible: me.rootVisible,
                animate: me.enableAnimations,
                singleExpand: me.singleExpand,
                node: store.getRootNode(),
                hideHeaders: me.hideHeaders
            }, me.viewConfig);
    
            // If the user specifies the headers collection manually then dont inject our own
            if (!me.columns) {
                if (me.initialConfig.hideHeaders === undefined) {
                    me.hideHeaders = true;
                }
                me.addCls(me.autoWidthCls);
                me.columns = [{
                    xtype    : 'treecolumn',
                    text     : 'Name',
                    width    : Ext.isIE6 ? '100%' : 10000, // IE6 needs width:100%
                    dataIndex: me.displayField         
                }];
            }
    
            if (me.cls) {
                cls.push(me.cls);
            }
            me.cls = cls.join(' ');
    
            me.callParent();
    
            // TreeModel has to know about the TreeStore so that pruneRemoved can work properly upon removal
            // of nodes.
            me.selModel.treeStore = me.store;
    
            view = me.getView();
    
            // Do not continue processing the view if there has been a LockingView injected.
            if (view.isTreeView) {
    
                me.relayEvents(view, [
                    /**
                    * @event checkchange
                    * Fires when a node with a checkbox's checked property changes
                    * @param {Ext.data.NodeInterface} node The node who's checked property was changed
                    * @param {Boolean} checked The node's new checked state
                    */
                    'checkchange',
                    /**
                    * @event afteritemexpand
                    * @inheritdoc Ext.tree.View#afteritemexpand
                    */
                    'afteritemexpand',
                    /**
                    * @event afteritemcollapse
                    * @inheritdoc Ext.tree.View#afteritemcollapse
                    */
                    'afteritemcollapse'
                ]);
    
                // If the root is not visible and there is no rootnode defined, then just lets load the store
                if (!view.rootVisible && !me.getRootNode()) {
                    me.setRootNode({
                        expanded: true
                    });
                }
            }
        }

Thread Participants: 2