1. #1
    Sencha User
    Join Date
    Jul 2008
    Posts
    126
    Vote Rating
    0
    jfizer is on a distinguished road

      0  

    Default Issues migrating a 2.x TreePanel extension to 4.x Ext.tree.TreeLoader() constructor.

    Issues migrating a 2.x TreePanel extension to 4.x Ext.tree.TreeLoader() constructor.


    Starting to work through issues updating a rather large app from ExtJS 2.x to 4.x, first issue I'm running into is an attempt to extend the TreePanel class and the now depreciated Ext.tree.TreeLoader() constructor. Any pointers as to where to start?

    Code:
    SimpleTreePanel = Ext.extend(Ext.tree.TreePanel, {
        title: 'Sample Tree Panel',
        width: 200,
        height: 400,
        loader: new Ext.tree.TreeLoader(),
        rootVisible: false,
        border: true,
                autoScroll: true,
                listeners : {  
                        'click' : function(node, event) {  
                                if (node.isLeaf() && node.attributes.view) { 
                                        fetchKeyword("TimeoutPeriod",myTimer.init);
                                        loadGridScript(node.attributes.view,'js');
                                        event.stopEvent();  
                                }
                        }, 'mouseover' : function(node, event) {  
                                 window.status=node.text;
                        }   
                },
        initComponent: function(){
            Ext.apply(this, {
                root: new Ext.tree.AsyncTreeNode({
                    children: myViews
                })
            })
    
            SimpleTreePanel.superclass.initComponent.apply(this, arguments);
        }
    });
    Ext.reg('tree_panel', SimpleTreePanel);
        var leftMenu = new SimpleTreePanel({
                region:'west',
        title: 'Navigation',
        collapsible: true,
        margins:'0 0 0 0',
        split:true,
        width: 225
        });

  2. #2
    Sencha User
    Join Date
    Jul 2008
    Posts
    126
    Vote Rating
    0
    jfizer is on a distinguished road

      0  

    Default


    Bueller?

  3. #3
    Sencha User
    Join Date
    Apr 2012
    Location
    Austin, Texas
    Posts
    2
    Vote Rating
    0
    brian.moeskau is an unknown quantity at this point

      0  

    Default


    I would start by looking at the 4.0 tree examples. The tree API has changed rather significantly and it might be easier to follow by example. There will also be a detailed guide to using the new tree components coming out shortly with Ext 4.

  4. #4
    Sencha User
    Join Date
    Jul 2008
    Posts
    126
    Vote Rating
    0
    jfizer is on a distinguished road

      0  

    Default


    Quote Originally Posted by brian.moeskau View Post
    I would start by looking at the 4.0 tree examples. The tree API has changed rather significantly and it might be easier to follow by example. There will also be a detailed guide to using the new tree components coming out shortly with Ext 4.

    The problem of course is that I cant remember why I needed to make this extension to the tree class in the first place. Avoiding a total re-write of the app is crucial as it has evolved in an organic manor as issues have been found or new features have been desired over the years.

  5. #5
    Sencha User
    Join Date
    Jul 2008
    Posts
    126
    Vote Rating
    0
    jfizer is on a distinguished road

      0  

    Default


    Other then http://dev.sencha.com/deploy/ext-4.0...tree/tree.html which examples of the 4.0 tree view are there?

  6. #6
    Sencha User
    Join Date
    Jul 2008
    Posts
    126
    Vote Rating
    0
    jfizer is on a distinguished road

      0  

    Default


    Think I got it... looks like I can replace my old code with the following to get much the same results.

    Code:
        var leftMenu = Ext.create('Ext.tree.TreePanel', {
        region:'west',
            title: 'Navigation',
            collapsible: true,
            margins:'0 0 0 0',
            split:true,
            width: 225,
            height: 400,
            rootVisible: false,
            border: true,
        autoScroll: true,
        root: {
            nodeType: 'async',
            text: 'rootTitle',
            expanded: true,
            children: myViews
        }
        });

Similar Threads

  1. Ext.tree.TreeLoader is not a constructor?
    By safewolf in forum Ext: Discussion
    Replies: 5
    Last Post: 1 Aug 2012, 2:26 AM
  2. [CLOSED][DUP]Ext.tree.TreePanel constructor config problem
    By gabriele.muscas in forum Ext:Bugs
    Replies: 1
    Last Post: 3 Apr 2011, 12:35 AM
  3. TreeLoader extension to update a TreePanel
    By mabello in forum Ext 2.x: User Extensions and Plugins
    Replies: 44
    Last Post: 18 Mar 2009, 2:29 AM
  4. TreePanel / TreeLoader / unable to load tree
    By RipHard in forum Ext 2.x: Help & Discussion
    Replies: 0
    Last Post: 15 Oct 2008, 11:55 PM
  5. issues with migrating paging toolbar to ext 2.0
    By tobiu in forum Ext 2.x: Help & Discussion
    Replies: 5
    Last Post: 2 Nov 2007, 10:24 AM

Thread Participants: 1