Hybrid View

    Success! Looks like we've fixed this one. According to our records the fix was applied for EXTJS-7794 in a recent build.
  1. #1
    Sencha Premium Member
    Join Date
    Nov 2012
    Posts
    14
    Vote Rating
    0
    Alvaro L is on a distinguished road

      0  

    Default Tree collapse selects all children (performance issue)

    Tree collapse selects all children (performance issue)


    I have a tree with a terrible performance, profiling I saw that the function I have attached to the selectionchange event of the selection model is called tons of times when you collapse a node. I created a small test case for this, you can run it and check the console when the root is collapsed:

    Code:
    <html>
    <head>
        
        <title>ExtJS Example</title>
        
        <link rel="stylesheet" type="text/css" href="javascript/extjs/resources/css/ext-all.css"/>
        
        <script type="text/javascript" src="javascript/extjs/ext-all-debug.js"></script>
    
    
        <script type="text/javascript">
            Ext.onReady(function() 
            {
                var root = {text : 'root', children :[]},
                    counter = 0;
                for (var i = 0; i < 99; i++)
                   {
                    root.children.push({text : 'child'+i, leaf:true});
                   }
                Ext.create('Ext.container.Viewport',
                {
                    layout: 'border',
                    items:
                    [
                        Ext.create('Ext.tree.Panel',
                        {
                            title : 'tree',
                            region: 'west',
                            split: true,
                            width: 300,
                            selModel : Ext.create('Ext.selection.RowModel', 
                            {
                                listeners : 
                                {
                                    selectionChange : function()
                                    {
                                        counter++;
                                        console.log(counter);
                                    }
                                }
                            }),
                            store : Ext.create('Ext.data.TreeStore',
                            {
                                root : root
                            })
                        })
                    ]
                });
            });
        </script>
    </head>   
    <body></body>
    </html>
    This is a performance killer if you have a function slightly more complex than the one I added in this code...

    I am the only one that found this? If this is not a bug, please explain the behavior and move the topic to the correct forum.

  2. #2
    Sencha - Support Team mike.estes's Avatar
    Join Date
    Mar 2011
    Location
    Redwood City, CA
    Posts
    220
    Vote Rating
    8
    mike.estes will become famous soon enough

      0  

    Default


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

  3. #3
    Sencha - Ext JS Dev Team evant's Avatar
    Join Date
    Apr 2007
    Location
    Sydney, Australia
    Posts
    16,119
    Vote Rating
    507
    evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute

      0  

    Default


    There's a couple of points here:

    1) Trees should use selection.TreeModel. Currently it's not documented, but it needs to be and will be in future versions.

    2) The selection model does need to check some extra stuff before firing events, which we'll fix up as well.

    Thanks for the test case.
    Evan Trimboli
    Sencha Developer
    Twitter - @evantrimboli
    Don't be afraid of the source code!

  4. #4
    Sencha Premium Member
    Join Date
    Nov 2012
    Posts
    14
    Vote Rating
    0
    Alvaro L is on a distinguished road

      0  

    Default


    Quote Originally Posted by evant View Post
    There's a couple of points here:

    1) Trees should use selection.TreeModel. Currently it's not documented, but it needs to be and will be in future versions.

    2) The selection model does need to check some extra stuff before firing events, which we'll fix up as well.

    Thanks for the test case.
    This really solved my problem, nevertheless, that class is marked as private:

    NOTE
    This is a private utility class for internal use by the framework. Don't rely on its existence.


    I understand from there that it should not be used directly


    About the second point, everything that can make software better is good news

    Thanks for the quick support.

    Cheers

film izle

hd film izle

film sitesi

takipci kazanma sitesi

takipci kazanma sitesi

güzel olan herşey

takipci alma sitesi

komik eğlenceli videolar