Page 2 of 3 FirstFirst 123 LastLast
Results 11 to 20 of 25

Thread: c is not a constructor message at the very first example

    Success! Looks like we've fixed this one. According to our records the fix was applied for EXTJS-5216 in a recent build.
  1. #11
    Sencha User
    Join Date
    May 2011
    Posts
    92
    Vote Rating
    0
      0  

    Default

    they are loaded at the point of time. it is really annoying if it is some sort of failure in Ext.define but silent or swallowed by extjs. without accurate error message, I can't find the root cause and fix it. especially, it is not a standard js error.

    once again, this morning I find another interesting issue. previously, I put all required classes in the "requires" block of my Ext.application. after reading the document saying that model referred in store via "model" config will be loaded automatically, I removed those models from "requires" block. now, I got "c is not a constructor" error when call Ext.create on my stores!

    I like the new MVC architect. but all these silent problems/bugs...

  2. #12
    Ext JS Premium Member stevil's Avatar
    Join Date
    Nov 2007
    Location
    Denver, CO
    Posts
    1,045
    Vote Rating
    10
      0  

    Default

    so if you put the models back into requires, it works?

    stevil

  3. #13
    Sencha User
    Join Date
    May 2011
    Posts
    92
    Vote Rating
    0
      0  

    Default

    Quote Originally Posted by stevil View Post
    so if you put the models back into requires, it works?

    stevil
    yes, back to Ext.application, not Ext.define of the store which needs this model.

    somehow, I thought I found the root cause. It is a part of how the new MVC architecture works.


    I had the following lines in my tree panel, sometimes extjs execute the Ext.create before 'App.store.Tree' is loaded (the call in firebug listed as a XHR). I thought extjs MVC will load all required classes before processing configs. looks like I am wrong. don't have too much time to dig into mvc source code. hope sencha will provide better document about the fundamental of class loading and mvc architect. the current simple example doesn't explain much.

    Code:
    requires : [ 'App.store.Tree' ],
    store : Ext.create('App.store.Tree'),

    now I switched to use a controller which include store, and put store reference id instead of Ext.create. everything works now.

  4. #14
    Ext JS Premium Member stevil's Avatar
    Join Date
    Nov 2007
    Location
    Denver, CO
    Posts
    1,045
    Vote Rating
    10
      0  

    Default

    All's well that ends...

    stevil

  5. #15
    Sencha User
    Join Date
    Jun 2009
    Posts
    7
    Vote Rating
    0
      0  

    Default

    Hi,

    thanks for the advise, even if that doesn't sound so good for me :-)

    I will look through that during the weekend and will let you know any further information I will get.

    Thanks to all and have a nice weekend.

    Hauke

  6. #16
    Sencha User
    Join Date
    Feb 2011
    Posts
    104
    Vote Rating
    0
      0  

    Default

    *interested*

  7. #17
    Sencha User
    Join Date
    Feb 2011
    Posts
    104
    Vote Rating
    0
      0  

    Default

    I got it running with

    PHP Code:
    Ext.Loader.setConfig({
        
    enabledtrue,
        
    paths: {
            
    'Ext''ext-4.0/src',
            
    'yourAppName''app'
        
    }
    });

    Ext.require([
        
    'Ext.data.Store',
        
    'Ext.data.StoreManager',
        
    'Ext.data.HasManyAssociation',
        
    'Ext.data.BelongsToAssociation',
        
    'Ext.container.Viewport',
        
    'Ext.grid.*',
        
    'Ext.util.*',
        
    'Ext.state.*',
        
    'Ext.form.*'
    ]); 

  8. #18
    Sencha User
    Join Date
    Nov 2011
    Posts
    1
    Vote Rating
    0
      0  

    Default

    can you try by adding **** requires : [ 'Ext.container.Viewport'], ******* to Ext.application so that it looks lilke

    Ext.application({

    requires : [ 'Ext.container.Viewport'],

    name: 'AM',

    appFolder: 'app',


    launch: function() {
    Ext.create('Ext.container.Viewport', {
    layout: 'fit',
    items: [
    {
    xtype: 'panel',
    title: 'Users',
    html : 'List of users will go here'
    }
    ]
    });
    }
    });

  9. #19
    Sencha User
    Join Date
    Nov 2011
    Posts
    1
    Vote Rating
    0
      0  

    Default web server

    Try to use web server instead on opening files locally. Looks like loader doesnt work on local files.

    Http proxies and chrome extensions work on web server only too.

  10. #20
    Sencha User
    Join Date
    Jun 2010
    Location
    Trivandrum, India
    Posts
    7
    Vote Rating
    0
      0  

    Thumbs up It's working now

    I got the same error when i tried it for the first time and now it's working after adding
    requires : [ 'Ext.container.Viewport'],
    Thank you gyus

Page 2 of 3 FirstFirst 123 LastLast

Posting Permissions

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