This issue duplicates another issue.
  1. #1
    Ext Premium Member Jan (HL)'s Avatar
    Join Date
    Aug 2010
    Location
    Germany
    Posts
    111
    Vote Rating
    9
    Jan (HL) will become famous soon enough

      0  

    Default [4.1.2] Root not visible, error in tree

    [4.1.2] Root not visible, error in tree


    Hi,

    I'm upgrading from 4.1.1 to 4.1.2 (a) and noticed a bug in the new bulkupdate/edit feature of the tree store.

    Situation: A TreeStore within a TreePanel with a remote tree (json returns a collection of items = nodes).

    If the root node is disabled (via rootVisible=false) or the root node is expanded at default, the script breaks at a NPE:

    File Ext.view.Table l. 467 of refreshSize "me.table.attach(me.el.child('table', true));"

    The object "me.el" is null.

    PHP Code:
     refreshSize: function() {
            var 
    me this,
                
    cmp;

            
    // On every update of the layout system due to data update, capture the table's DOM in our private flyweight
            
    me.table.attach(me.el.child('table'true));

           if (!
    me.hasLoadingHeight) { 
    My Patch:
    PHP Code:
    Ext.override(Ext.view.Table, {
        
    refreshSize : function() {
            var 
    me thiscmp;
            
    // On every update of the layout system due to data update, capture the table's DOM in our private flyweight
            
    if (me.el) {
                
    me.table.attach(me.el.child('table'true));
            }

            if (!
    me.hasLoadingHeight) {
                
    cmp me.up('tablepanel');

                
    // Suspend layouts in case the superclass requests a layout. We might too, so they
                // must be coalescsed.
     
               
    Ext.suspendLayouts();

                
    Ext.view.AbstractView.prototype.refreshSize.call(this);

                
    // If the OS displays scrollbars, and we are overflowing vertically, ensure the
                // HeaderContainer accounts for the scrollbar.

                
    if (cmp && Ext.getScrollbarSize().width && (me.autoScroll || me.overflowY)) {
                    
    cmp.updateLayout();
                }
                
    Ext.resumeLayouts(true); 
           }
        }
    }); 
    Actually, I'd only added a wrapper (if me.el) and changed the "this.callParent" with an explicit call of the parent view.. this.callParent called the Ext.view.Table.refreshSize...??)

    Do you need additional information and/or demo? I'm currently a little bit busy.. next days/next week.

  2. #2
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    37,015
    Vote Rating
    847
    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


    Using the check-tree.html example I'm not getting an error and it has rootVisible : false.
    Mitchell Simoens @SenchaMitch
    Sencha Inc, Senior Forum Manager
    ________________
    Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
    https://github.com/mitchellsimoens

    Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/

    Need more help with your app? Hire Sencha Services services@sencha.com

    Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is in print!

    When posting code, please use BBCode's CODE tags.

  3. #3
    Ext Premium Member Jan (HL)'s Avatar
    Join Date
    Aug 2010
    Location
    Germany
    Posts
    111
    Vote Rating
    9
    Jan (HL) will become famous soon enough

      0  

    Default


    Oops, I'd forgotten the title... :/

    Is there is possibility to get a "public" extjs 4.1.2? Otherwise I can only provide a non-public web-demo.

  4. #4
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    37,015
    Vote Rating
    847
    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


    4.1.2 is only for support subscribers
    Mitchell Simoens @SenchaMitch
    Sencha Inc, Senior Forum Manager
    ________________
    Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
    https://github.com/mitchellsimoens

    Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/

    Need more help with your app? Hire Sencha Services services@sencha.com

    Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is in print!

    When posting code, please use BBCode's CODE tags.

  5. #5
    Sencha - Ext JS Dev Team evant's Avatar
    Join Date
    Apr 2007
    Location
    Sydney, Australia
    Posts
    16,908
    Vote Rating
    626
    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  
    Evan Trimboli
    Sencha Developer
    Twitter - @evantrimboli
    Don't be afraid of the source code!

  6. #6
    Ext Premium Member Jan (HL)'s Avatar
    Join Date
    Aug 2010
    Location
    Germany
    Posts
    111
    Vote Rating
    9
    Jan (HL) will become famous soon enough

      0  

    Default


    Okay.

    I'd already spent some hours to reproduce it.. and finally, I can tell you following.

    First: In the attachment you find a zip containing the actual test case with a bootstrap index.html and an app.js. Furthermore, this requires a dynamic tree store so I provide you a nodejs script to boot up a small server which fakes a dynamic tree where each node will loaded async.

    I.e.
    Code:
    node server.js 
    Server running at http://127.0.0.1:8125/
    Second: Reproduce
    * Expand each node to "Customers / Customer 1 / Hosts / Host A" and select it.
    * Hit "refresh" -> error in console.

    Third: This actually means, that the bug has nothing to to with the root node. It has actually occured earlier because the root node was expanded.

    Fouth: I add the following video demo so that you can actually see the problem: http://screencast.com/t/SmEXpp5YQLhO

    Fifth: So long, the problem occours in the "updateIndexes" method of Ext.view.AbstractView (ll 792). If I understand this correct, the method is used to synchronize the nodeInternalId from the record TO the dom element. This is okay in most cases but exactly in THIS case not. I noticed that the dom elements have an element twice (which is incorrect), so that "ns" is one element larger than "records" and therefor will produce a npe at line 801.
    Attached Files

  7. #7
    Ext Premium Member Jan (HL)'s Avatar
    Join Date
    Aug 2010
    Location
    Germany
    Posts
    111
    Vote Rating
    9
    Jan (HL) will become famous soon enough

      0  

    Default


    should I open a new thread?

Thread Participants: 2