Results 1 to 5 of 5

Thread: [4.2.0 RC] Expanding a tree node causes multiple layouts

Hybrid View

Previous Post Previous Post   Next Post Next Post
    Success! Looks like we've fixed this one. According to our records the fix was applied for EXTJS-9038 in a recent build.
  1. #1
    Sencha User Daniil's Avatar
    Join Date
    Jun 2010
    Location
    Saint-Petersburg, Russia
    Posts
    1,017
    Vote Rating
    125
      0  

    Default [4.2.0 RC] Expanding a tree node causes multiple layouts

    REQUIRED INFORMATION

    Ext version tested:

    • Ext 4.2.0 RC

    Browser versions tested against:
    • IE9
    • Chrome

    DOCTYPE tested against:
    • <!DOCTYPE html>

    Description:
    • Expanding a tree node causes multiple layouts. Expanding a node with children causes two layouts. Expanding a non-leaf node without children causes four layouts. It seems too many and possibly can cause performance issues.

    Steps to reproduce the problem:
    • Expand nodes

    The result that was expected:
    • A single layout

    The result that occurs instead:
    • Two or four layouts

    Test Case:

    Code:
    <!DOCTYPE html>
    <html>
    <head>
        <title>Expanding a node causes multiple layouts</title>
    
        <link rel="stylesheet" href="../resources/css/ext-all.css" />
    
        <script src="../ext-all-debug.js"></script>
    
        <script>
            Ext.onReady(function () {
                var children = [];
                for (var i = 0; i < 50; i++) {
                    children.push({
                        text: "SubNode" + i
                    });
                }
                var tree = Ext.create("Ext.tree.Panel", {
                    renderTo: Ext.getBody(),
                    height: 450,
                    width: 300,
                    root: {
                        text: "Root",
                        children: children
                    },
                    listeners: {
                        afterlayout: {
                            fn: function () {
                                console.log('layout');
                            }
                        }
                    }
                });
            });
        </script>
    </head>
    <body>
    </body>
    </html>
    Object.NET
    Frameworks and Tools for .NET Developers
    --------------------------------------------------
    Ext.NET - Ext JS for ASP.NET - Examples | Twitter
    Bridge.NET - Write C#. Run JavaScript! - Live | Twitter
    --------------------------------------------------

  2. #2
    Sencha Premium User mankz's Avatar
    Join Date
    Nov 2007
    Location
    Stockholm, Sweden
    Posts
    3,042
    Vote Rating
    182
      0  

    Default

    We've seen this for a while too, hacking past it using this override:

    Code:
    this.override({
                    expand : function () {
                        Ext.suspendLayouts();
                        this.callParent(arguments);
                        Ext.resumeLayouts();
                    }
                });

  3. #3
    Sencha - Ext JS Dev Team Animal's Avatar
    Join Date
    Mar 2007
    Location
    Notts/Redwood City
    Posts
    30,607
    Vote Rating
    59
      0  

    Default

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

  4. #4
    Sencha User
    Join Date
    Jul 2014
    Posts
    6
    Vote Rating
    0
      0  

    Default

    Hello,


    I have the same problem with 4.2.1.883 version. This version doesn't have to contain the patch?


    I don't succeed to use your hack.


    What's "this" containing the "override" method?


    I suppose this is "Ext.Base", but the API documentation indicates the "override()" method as deprecated.


    So, I did it:
    Ext.define('RG.components.tree.Panel', {
    extend: 'Ext.tree.Panel',
    expand : function () {
    Ext.suspendLayouts();
    this.callParent(arguments);
    Ext.resumeLayouts();
    }
    });


    And I created an object with "RG.components.tree.Panel" as type instead of "Ext.tree.Panel" but it doesn't work.


    Do you have an idea?


    Thanks for your help.

  5. #5
    Sencha User
    Join Date
    Jul 2014
    Posts
    6
    Vote Rating
    0
      0  

    Default

    Really sorry because the problem seems to be corrected...
    I had clear my browser cache without success, but after a Tomcat restart, it seems ok!
    Classical...

Posting Permissions

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