Results 1 to 2 of 2

Thread: [4.1.2] Unable to sort tree node in an un-rendered tree

    Success! Looks like we've fixed this one. According to our records the fix was applied for EXTJS-7248 in a recent build.
  1. #1
    Ext JS Premium Member
    Join Date
    Oct 2007
    Posts
    114
    Vote Rating
    4
      0  

    Default [4.1.2] Unable to sort tree node in an un-rendered tree

    "ext-all-debug.js:96394TypeError: 'undefined' is not an object (evaluating 'me.el.child')"

    Code:
    Ext.onReady(function() {
    
            var store = Ext.create('Ext.data.TreeStore', {
                root: {
                    expanded: true,
                    children: [
                        { text: "detention", leaf: true },
                        { text: "homework", expanded: true, children: [
                            { text: "book report", leaf: true },
                            { text: "alegrbra", leaf: true}
                        ] },
                        { text: "buy lottery tickets", leaf: true }
                    ]
                }
            });
    
            var tree = Ext.create('Ext.tree.Panel', {
                title: 'Simple Tree',
                width: 200,
                height: 150,
                store: store,
                rootVisible: false,
                store: store
            });
    
            //tree.render(Ext.getBody());
    
            tree.getRootNode().sort(function(n1, n2) {
                var v1 = n1.data['text'].toUpperCase();
                var v2 = n2.data['text'].toUpperCase();
    
                if (v1 < v2)
                    return -1;
                else if (v1 > v2)
                    return 1;
                return 0;
            });     
    });

  2. #2
    Sencha - Sr Software Engineer mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    39,553
    Vote Rating
    1272
      0  

    Default

    This has been fixed for 4.1.3
    Mitchell Simoens @LikelyMitch
    Sencha Inc, Senior Software Engineer
    ________________
    Learn BBCode and use it! Checkout the CODE tag!

    Check out my GitHub, lots of nice things for Ext JS and Sencha Touch
    https://github.com/mitchellsimoens

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •