1. #1
    Sencha User
    Join Date
    Jul 2013
    Location
    Tel Aviv, Israel
    Posts
    38
    Vote Rating
    0
    alonlevi is on a distinguished road

      0  

    Default Sencha CMD + association

    Sencha CMD + association


    Hello,
    I can't seem to be able create a production or test deployment of an app that include any kind of Model association (hasMany/belongsTo).

    I tried this very simple project (i'm working with Architect 2) - just a simple two models structure and a container with an image as a viewer. it works great until I add the association to the model. I tried adding "requires" to any class I could think of -
    Ext.data.Association
    Ext.data.ModelManager
    Ext.data.association.HasMany


    But still it gives me the horrible message-

    Uncaught TypeError: Cannot call method 'error' of undefined


    I tried CMD 3.2.1, even the new 4.0 BETA... nothing seems to work...
    WHAT AM I MISSING?

  2. #2
    Sencha - Support Team slemmon's Avatar
    Join Date
    Mar 2009
    Location
    Boise, ID
    Posts
    6,012
    Vote Rating
    212
    slemmon has much to be proud of slemmon has much to be proud of slemmon has much to be proud of slemmon has much to be proud of slemmon has much to be proud of slemmon has much to be proud of slemmon has much to be proud of slemmon has much to be proud of

      0  

    Default


    I've not heard of that before. Just to test can you add a requires of 'Ext.data.*' and see if you're still getting the issue?
    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

  3. #3
    Sencha User
    Join Date
    Jul 2013
    Location
    Tel Aviv, Israel
    Posts
    38
    Vote Rating
    0
    alonlevi is on a distinguished road

      0  

    Default Nothing helps

    Nothing helps


    I tried adding Ext.data but gon an error (no such class?)... but I did add the following :
    'Ext.data.ModelManager',
    'Ext.data.Association'

    and inside the model i've added
    Ext.data.association.HasMany
    Ext.data.association.BelongsTo


    It works before building (sencha app build) but not after!
    i've tried all three options - sencha app build production/testing and also sencha app build package....


    all fail...

    wtf?

  4. #4
    Sencha - Support Team slemmon's Avatar
    Join Date
    Mar 2009
    Location
    Boise, ID
    Posts
    6,012
    Vote Rating
    212
    slemmon has much to be proud of slemmon has much to be proud of slemmon has much to be proud of slemmon has much to be proud of slemmon has much to be proud of slemmon has much to be proud of slemmon has much to be proud of slemmon has much to be proud of

      0  

    Default


    When working in dev are you using the 'ext.dev.js' file in your index page? If so, do you see an errors logged in the console saying that a class has been loaded synchronously with a suggestion to add the class to a requires statement?

    *Also, the syntax for loading all data classes just for testing would be Ext.require(['Ext.data.*']); or if you're using a requires config on a controller - requires: ['Ext.data.*'] - don't forget the.* after Ext.data.
    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

  5. #5
    Sencha User
    Join Date
    Jul 2013
    Location
    Tel Aviv, Israel
    Posts
    38
    Vote Rating
    0
    alonlevi is on a distinguished road

      0  

    Default


    Well... It half-worked...(using Ext.data.*)
    it now works with SENCHA APP BUILD (production) but doesn't work with SENCHA APP BUILD PACKAGE....

    what the difference classes wize?

  6. #6
    Sencha - Support Team slemmon's Avatar
    Join Date
    Mar 2009
    Location
    Boise, ID
    Posts
    6,012
    Vote Rating
    212
    slemmon has much to be proud of slemmon has much to be proud of slemmon has much to be proud of slemmon has much to be proud of slemmon has much to be proud of slemmon has much to be proud of slemmon has much to be proud of slemmon has much to be proud of

      0  

    Default


    To clarify, can you tell me what framework you're building on (ExtJS or Touch) and what version of framework you're working with?
    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

  7. #7
    Sencha User
    Join Date
    Jul 2013
    Location
    Tel Aviv, Israel
    Posts
    38
    Vote Rating
    0
    alonlevi is on a distinguished road

      0  

    Default


    Using Architect 2.22 with Touch 2.21 and Cmd 4.0

  8. #8
    Sencha User
    Join Date
    Jul 2013
    Location
    Tel Aviv, Israel
    Posts
    38
    Vote Rating
    0
    alonlevi is on a distinguished road

      0  

    Default


    in the console, it seems that when accessing Ext.Logger this issue happens - it seems that Ext.Logger is undefined... but I can't seems to be able in require it (sencha CMD throws an error)...

    applyAssociatedModel: function(associatedName) {
    var associatedModel = Ext.data.ModelManager.types[associatedName];
    if (associatedModel === undefined) {
    Ext.Logger.error('The configured associatedModel was not valid (you tried ' + associatedName + ')');
    Uncaught TypeError: Cannot call method 'error' of undefined



    }
    return associatedModel;
    },

  9. #9
    Sencha - Support Team slemmon's Avatar
    Join Date
    Mar 2009
    Location
    Boise, ID
    Posts
    6,012
    Vote Rating
    212
    slemmon has much to be proud of slemmon has much to be proud of slemmon has much to be proud of slemmon has much to be proud of slemmon has much to be proud of slemmon has much to be proud of slemmon has much to be proud of slemmon has much to be proud of

      0  

    Default


    When running your app in dev mode do you see any messages in the developer console like:
    [Ext.Loader] Synchronously loading 'Ext.data.reader.Xml'; consider adding Ext.require('Ext.data.reader.Xml') above Ext.onReady

    where any classes are explicitly noted as having been loaded Synchronously?
    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

  10. #10
    Sencha User
    Join Date
    Jul 2013
    Location
    Tel Aviv, Israel
    Posts
    38
    Vote Rating
    0
    alonlevi is on a distinguished road

      0  

    Default


    Quote Originally Posted by slemmon View Post
    When running your app in dev mode do you see any messages in the developer console like:
    [Ext.Loader] Synchronously loading 'Ext.data.reader.Xml'; consider adding Ext.require('Ext.data.reader.Xml') above Ext.onReady
    Nope.
    I would of course mention it if it happened.
    I'm testing on four versions - the original development (touch-all-debug), and three flavours of sencha app build (testing,production,package). the original & production version work (locally only. when uploaded to server it doesn't) and testing/package version don't work at all.

    I know it's all related to association because when I remove the HasMany config from the model - it works flawlessly...