1. #41
    Sencha User subv3rsion's Avatar
    Join Date
    Jul 2011
    Posts
    11
    Vote Rating
    0
    subv3rsion is on a distinguished road

      0  

    Default Uncaught TypeError: Cannot read property 'shadow' of undefined

    Uncaught TypeError: Cannot read property 'shadow' of undefined


    Dropped in the Ext JS 4.1 RC1 to our project to get a sense for what we have to do to migrate. Unfortunately our MVC application will not load views as \src\util\Floating.js throws an exception:

    Code:
    Uncaught TypeError: Cannot read property 'shadow' of undefined
    Code:
    Uncaught TypeError: Cannot read property 'shadow' of undefined
    Ext.define.setActive                                Floating.js:255
    Ext.override.render                                 Initialization.js:72
    Ext.define.index                                    Viewport.js:52
    Ext.define.onViewportRendered                       Viewport.js:64
    fire                                                ext-debug.js:13421
    Ext.define.dispatch                                 EventBus.js:49
    Ext.override.fireEvent                              EventBus.js:23
    Ext.define.finishRender                             Renderable.js:420
    Ext.define.render                                   Renderable.js:740
    Ext.define.constructor                              AbstractComponent.js:1040
    Base.implement.callParent                           ext-debug.js:5954
    Ext.define.constructor                              Component.js:365
    constructor                                         ext-debug.js:6255
    (anonymous function)
    Ext.ClassManager.instantiate                        ext-debug.js:7725
    (anonymous function)                                ext-debug.js:2820
    Ext.application.launch                              app.js:140
    Ext.define.onBeforeLaunch                           Application.js:205
    Base.implement.callParent                           ext-debug.js:5954
    Ext.override.onBeforeLaunch                         Router.js:311
    (anonymous function)                                Application.js:171
    isEvent                                             ext-debug.js:13275
    fire                                                ext-debug.js:13421
    Ext.apply.readyEvent.event.fire                     ext-debug.js:13622
    Ext.apply.onDocumentReady                           ext-debug.js:13714
    Ext.apply.onReady.fn                                ext-debug.js:9387
    Ext.apply.triggerReady                              ext-debug.js:9373
    Ext.apply.refreshQueue                              ext-debug.js:8974
    Ext.apply.refreshQueue                              ext-debug.js:8975
    Ext.apply.onFileLoaded                              ext-debug.js:9312
    (anonymous function)                                ext-debug.js:2806
    Ext.apply.injectScriptElement.onLoadFn
    I have started going through the Don thread to look at API changes, but nothing is jumping out at me.

  2. #42
    Sencha Premium Member skirtle's Avatar
    Join Date
    Oct 2010
    Location
    UK
    Posts
    3,596
    Vote Rating
    324
    skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future

      0  

    Default


    @subv3rsion. I'd guess the problem is line 72 of Initialization.js. What is Initialization.js and what does the render method do (is it an override of the component method render or is it an event handler on a non-component class)? It looks like it is trying to set the active window before the window is rendered. You may need to alter your timing slightly, like moving the logic to activate the window a little later (possibly afterRender).

    The timing of certain calls in the rendering process is one of the changes that have been made in 4.1. See the entry 'Component render' in Don's thread about API changes.

    If you need more help then you'll need to post the relevant code from Initialization.js.

  3. #43
    Sencha User
    Join Date
    Oct 2011
    Location
    Ukraine
    Posts
    154
    Vote Rating
    6
    Romick is on a distinguished road

      0  

    Question skirtle

    skirtle


    @skirtle Thank you to look into.
    I have folowing modification:
    Code:
    var store = Ext.create('Ext.data.Store', {
        fields: ['name'],
        data: [
            {name: 'Adam'},
            {name: 'Brian'}
        ]
    });
    
    console.log(store.getCount());
    console.log(store.getAt(0).get('name'));
    console.log(store.getAt(1).get('name'));
    
    store.sort('name', 'ASC');
    
    store.add({name: 'A_Charles'});
    
    console.log(store.getCount());
    console.log(store.getAt(0).get('name'));
    console.log(store.getAt(1).get('name'));
    console.log(store.getAt(2).get('name'));
    Actually I noticed that it's breaks down after sort method. Is it now asynchronous?

    Any suggestion?

  4. #44
    Sencha User subv3rsion's Avatar
    Join Date
    Jul 2011
    Posts
    11
    Vote Rating
    0
    subv3rsion is on a distinguished road

      0  

    Default


    Quote Originally Posted by skirtle View Post
    @subv3rsion. I'd guess the problem is line 72 of Initialization.js. What is Initialization.js and what does the render method do (is it an override of the component method render or is it an event handler on a non-component class)? It looks like it is trying to set the active window before the window is rendered. You may need to alter your timing slightly, like moving the logic to activate the window a little later (possibly afterRender).

    The timing of certain calls in the rendering process is one of the changes that have been made in 4.1. See the entry 'Component render' in Don's thread about API changes.

    If you need more help then you'll need to post the relevant code from Initialization.js.
    @skirtle

    Interesting just started to read the API changes. I didn't catch the Initialization in the stack trace or I would have caught that and posted it as well. You are correct in override. We started using a custom Router extension from https://github.com/brunotavares/Ext.ux.Router which is where Initialization.js comes from.

    CSI.* is the namespace and 'layoutappview' is a view which itself contains a header, middle, and footer. Where we swap out the middle view and load different application views. As the API changes for 4.1 you mention it looks as though render is the culprit.

    Code:
    /**
    *
    * Modelo de Login usando MCV
    * Desenvolvido por Ricardo Hirashiki
    * Publicado em: http://www.sitedoricardo.com.br
    * Data: Ago/2011
    *
    * Baseado nos exemplos disponibilizados em
    * https://github.com/brunotavares/Ext.ux.Router
    * 
    */
    
    
    Ext.define('Ext.ux.Initialization', {
        requires: [
    	    'Ext.ux.Router',
    	    'Ext.window.MessageBox',
    	    'CSI.util.Configuration'
    	]
    },
      (function () {
          console.log('Ext.ux.Initialization - begin');
          /* 
          * Override Ext.app.Controller to provide render capability. I believe each application
          * will handle rendering task different (some will render into a viewport, some in tabs, etc...), 
          * so I didn't put this role into Ext.ux.Route responsability.
          */
          Ext.override(Ext.app.Controller, {
              render: function (view) {
                  var viewInstance;
                  if (!view) {
                      view = "home.Home";
                  }
    
    
                  if (!CSI.util.Configuration.EULA) {
    
    
                      var viewport_main = Ext.getCmp('viewport-default');
                      var viewport_layoutappview = Ext.getCmp('layoutappview');
    
    
                      if (!viewport_layoutappview) {
                          viewport_main.removeAll();
                          viewport_main.add(Ext.widget('layoutappview'));
                          viewport_main.doLayout();
                      }
    
    
                      var middle = Ext.getCmp('layoutmiddle');
    
    
                      if (middle) {
                          middle.removeAll();
                          console.log(middle);
    
    
                          // Load view
                          if (Ext.isString(view)) {
                              view = this.getView(view);
                          }
    
    
                          // If it already exists, remove
                          element = middle.child(view.xtype);
                          if (element) {
                              middle.remove(element);
                          }
    
    
                          viewInstance = middle.add(view);
    
    
                          middle.setActive(true, viewInstance);
                          middle.doLayout();
    
    
                          return viewInstance;
                      }
                  } else {
                      Ext.ux.Router.redirect('eula');
                  }
    
    
                  /* Legacy Ajax for login routing.
                  Ext.Ajax.request({
                  url : 'data/islogged.json',   //Simula ERRO
                  method: 'GET',
                  scope:this,
                  success: function ( result, request ) {
    		
                  var retorno = Ext.decode(result.responseText);
                  if (retorno.success) {
                  var viewport_main = Ext.getCmp('viewport-default');
                  var viewport_layoutappview = Ext.getCmp('layoutappview');
    		    
                  if (!viewport_layoutappview){
                  viewport_main.removeAll();
                  viewport_main.add(Ext.widget('layoutappview'));
                  viewport_main.doLayout();
                  }
                  var middle = Ext.getCmp('layoutmiddle');
                  if (middle){
                  middle.removeAll();
                  console.log(middle);
                  //load view
                  if (Ext.isString(view)) {
                  view = this.getView(view);
                  }
    		       
                  //if it already exists, remove
                  element = middle.child(view.xtype);
                  if(element){
                  middle.remove(element);
                  }
                  middle.setActive(true,middle.add(view));
                  middle.doLayout();                
                  }
                  }else{
                  Ext.ux.Router.redirect('login');
                  }
                  },
                  failure: function ( result, request) { 
                  console.log(result);
                  console.log(request);
                  switch (result.failureType) {
                  case Ext.form.action.Action.CLIENT_INVALID:
                  Ext.MessageBox.alert('Error', "CLIENT_INVALID"); 
                  break;
                  case Ext.form.action.Action.CONNECT_FAILURE:
                  Ext.MessageBox.alert('Error', "CONNECT_FAILURE"); 
                  break;
                  case Ext.form.action.Action.SERVER_INVALID:
                  this.onAuthenticationFail(sender);
                  }
                  } 
                  });
                  */
              }
          });
    
    
          /* 
          * Ext.ux.Router provides some events for better controlling
          * dispatch flow
          */
          Ext.ux.Router.on({
              routemissed: function (uri) {
                  Ext.Msg.show({
                      title: 'Error 404',
                      msg: 'Route not found: ' + uri,
                      buttons: Ext.Msg.OK,
                      icon: Ext.Msg.ERROR
                  });
              },
              beforedispatch: function (uri, match, params) {
                  console.log(uri, match, params);
                  console.log('beforedispatch ' + uri);
              },
              dispatch: function (uri, match, params, controller) {
                  console.log('dispatch ' + uri);
                  //TIP: you could automize rendering task here, inside dispatch event
              }
          });
          console.log('Ext.ux.Initialization - end');
      })
    );

  5. #45
    Ext JS Premium Member neongrau's Avatar
    Join Date
    Mar 2007
    Posts
    249
    Vote Rating
    0
    neongrau is on a distinguished road

      0  

    Exclamation LoadMasks in collapsed / autoscrolling panels

    LoadMasks in collapsed / autoscrolling panels


    LoadMasks in collapsed / autoscrolling panels are pretty much as broken in 4.1 RC1 as they were in 4.0.x

    Thought i've read somewhere that these are fixed.

  6. #46
    Sencha User
    Join Date
    Oct 2011
    Posts
    2
    Vote Rating
    0
    gopiatfiport is on a distinguished road

      0  

    Default We are stuck on b2

    We are stuck on b2


    When we moved from b2 to b3, nothing displayed - the grids, tab panels, charts... There were no errors in the firefox error console. Tried rc1. Same result, nothing displayed. Would somebody who had to make code changes when moving from b2 to b3, please post some info on the nature of changes? Thank you.

  7. #47
    Ext JS Premium Member
    Join Date
    Feb 2010
    Posts
    38
    Vote Rating
    1
    sajohns4 is on a distinguished road

      0  

    Default Button Menu Bug

    Button Menu Bug


    When having a menuitem / menucheckitem with a wide text property the layout breaks in the nightly build from 4.1 in FF11 / IE9

    text values that work:
    1234567891113
    some random tex

    text values that break and no menu shows at all:
    12345678911134
    some random text

    PHP Code:
        Ext.create('Ext.container.Viewport', {
            
    layout'fit'
            
    borderfalse
            
    renderToExt.getBody(),
            
    items: [ {xtype:'panel'html'test'dockedItems: [
            {
    xtype'toolbar'
                
    items: [
                    {
    "xtype":"button","text":"Highlight","menu":
                        {
    "xtype":"menu",
                            
    "items":[
                               {
    xtype'menucheckitem'text:'some random text'value'1'checkedtrue},
                               {
    xtype'menucheckitem'text:'another'value'2'checkedfalse},
                            ]
                        }
                    }
                 ]
            }
            ]} 
            ]
        }); 

  8. #48
    Ext JS Premium Member
    Join Date
    Feb 2010
    Posts
    38
    Vote Rating
    1
    sajohns4 is on a distinguished road

      0  

    Default


    reposted under RC2..didn't see it was released last night