Thank you for reporting this bug. We will make it our priority to review this report.
  1. #1
    Sencha User
    Join Date
    Jan 2014
    Location
    Bangalore
    Posts
    1
    Vote Rating
    0
    Cyclone is on a distinguished road

      0  

    Default Event life cycle varies for tree panel in Firefox (V 26.0) and Chrome (V 32.0.1700)

    Event life cycle varies for tree panel in Firefox (V 26.0) and Chrome (V 32.0.1700)


    I am using ExtJS 4.2.1.

    I have a tree panel, which has a rest proxy store as a data source.

    A part of it can be represented like this:
    Code:
    Ext.define('MyApp.view.MyTreePanel', {
      extend: 'Ext.tree.Panel',
      hideHeaders: true,
      rootVisible: false,
      id: 'mytreepanel',
      store: 'StoreName'
    
     //  ... other configurations ...
    });
    The data which I have in the tree store, has got a rootnode with 3 child nodes and those nodes internally have 2, 3, 2 child nodes respectively. None of the nodes in the entire tree is expaned by default - meaning, I havne't used expanded: true in the store for nodes.

    And also I have one controller where I have bound the events for this view as below:

    Code:
    Ext.define('MyApp.view.MyController', {
      extend: 'Ext.app.controller',
      requies: ['MyApp.view.MyTreePanel'],
    
      refs: [{
        ref: 'myPanel',
        selector: '#mytreepanel'
      }],
    
      init: function() {
        this.control({
          '#mytreepanel': {
            load: this.expandLevel1,
            afteritemexpand: this.expandLevel2,
            viewready: function() {
              console.log('view viewready fired');
            },
            boxready: function() {
              console.log('view boxready fired');
            }        
          }
        });
      },
    
      expandLevel1: function() {
        // code to expand the level1 nodes
      },
    
      expandLevel2: function() {
        //code to expand the level2 nodes
      }
    
      // ... other config ...
    });
    So as soon as the store is loaded I expand the level1 nodes, and I bind event 'afteritemexpand' which triggers for all the nodes respectively as soon as the nodes are expanded, which iterates through the child nodes for the expanded node and does some stuff (not including it here as it might be irrelevant).

    The setup which I have is working fine in Chrome and IE (v 9).

    Strange thing happening here is, in Firefox, the afteritemexpand does not fire at all. So I believe, the code which is responsible to fire the 'afteritemexpand' event is not getting executed, as in ExtJS 4.2.1 src\tree\View.js the control return in the 'onExpand' method in one if condition, where comment says, 'The item is not visible yet'. But the lines of code are executed properly in Chrome and everything works as expected.

    I tried to put some console logs in src\tree\View.js and realized that the afteritemexpand event fires after viewready and boxready in chrome, whilst in firefox nothing happens, because the control returned as I said above and didn't fire the events. And also in firefox, I got logs from View.js before I got the logs for the viewready and boxready.

    And also when I try to get root node and its children (using getRootNode().childNodes) in viewready event, in firefox, I receive all the nodes in an array, whilst in chrome it returns an empty array.

    I tried to reproduce the issue in a smaller workspace which could be posted here, but unfortunately I am not able to reproduce it.

    I am not sure why this is happening, if not complete solution, any kind of pointer as in where shall I look for the problem, would be appreciated very well
    Live Long And Prosper

  2. #2
    Sencha - Support Team
    Join Date
    Feb 2013
    Location
    California
    Posts
    3,550
    Vote Rating
    66
    Gary Schlosberg is a jewel in the rough Gary Schlosberg is a jewel in the rough Gary Schlosberg is a jewel in the rough

      0  

    Default


    Without a test case it is difficult to proceed. It seems that this issue has been reported before:
    http://www.sencha.com/forum/showthread.php?280427
    http://www.sencha.com/forum/showthread.php?280428

    Seems we are having trouble reproducing the issue.
    Get on the Fast Track with Sencha Training http://sencha.com/training

    Are you a Sencha products veteran who has wondered what it might be like to work at Sencha? If so, please reach out to our recruiting manager: sheryl@sencha.com

Thread Participants: 1

Tags for this Thread