Results 1 to 9 of 9

Thread: Support for Ext.app.Controller models/stores/views

  1. #1
    Sencha Premium User
    Join Date
    Jan 2013
    Posts
    62
    Answers
    2
    Vote Rating
    4
      0  

    Default Answered: Support for Ext.app.Controller models/stores/views

    Maybe I have something configured incorrectly, but should the plugin be able to resolve the "models/stores/views" array config with the correct class? I'm getting the following warning: "Unknown store lead.LeadDetail".. etc.

    Code:
    Ext.define('LDB.controller.common.Lead', {
        extend: 'Ext.app.Controller',
    stores: [
            'lead.LeadDetail'
    ],
    views: [
            'customer.email.EmailWindow'
    ]
    });
    
    The full class paths being: LDB.store.lead.LeadDetail and LDB.view.customer.email.EmailWindow.

  2. Quote Originally Posted by Mark.Brocato View Post
    Lastly, can you verify that you've got an app.json file in the same root folder as app.js. Does the app.json file have a name property? Would you be able to post it so I could take a look?

    If your app.json file is missing, you can just add a trivial one to make the plugin work properly. All it needs is something like:

    Code:
    { "name" : "MyAppName" }
    Ah ok, looks like this was the issue. I didn't realize the app.json was required. When I copied it over to our "src" directory, it recognized all the views correctly. I assumed it would grab the app name from the "Application.js" file. All good now I think. Thanks!

  3. #2
    Sencha User Mark.Brocato's Avatar
    Join Date
    Mar 2015
    Location
    Maryland
    Posts
    482
    Answers
    114
    Vote Rating
    55
      0  

    Default

    You're right, they should be resolved, and my tests show that working correctly locally. Can you provide some more info about your environment? Specifically:

    What version of Ext JS/Touch are you using?
    If Ext JS 6, is your app universal, or configured for a single toolkit?
    Where do the classes you mentioned reside in the directory structure?
    What version of the plugin do you have installed?

  4. #3
    Sencha Premium User
    Join Date
    Jan 2013
    Posts
    62
    Answers
    2
    Vote Rating
    4
      0  

    Default

    I'm using ExtJS 5.1.1 and Plugin version 6.0.3.430. Also I'm using Webstorm 10.0.4. I added the ExtJS library under "Languages & Frameworks -> Javascript -> Libraries". I can see that most of the plugin features are working correctly... I.E. auto-suggest missing requires statements and such just for some reason these Controller shortcut configs aren't being matched up correctly.

    I have a normal directory structure I believe:
    Code:
    my_app
      app.js
      app.scss
      index.html
      app
        Application.js
        controller
          common
            Lead.js 
        model
        store
          lead
            LeadDetail.js
        view

  5. #4
    Sencha User Mark.Brocato's Avatar
    Join Date
    Mar 2015
    Location
    Maryland
    Posts
    482
    Answers
    114
    Vote Rating
    55
      0  

    Default

    You only have to add a JavaScript library if the Ext JS source code is outside of your project. Just curious, is that actually the case? For apps built with cmd the Ext JS source is generally in an directory named "ext" which is a peer to the "app" directory.

  6. #5
    Sencha User Mark.Brocato's Avatar
    Join Date
    Mar 2015
    Location
    Maryland
    Posts
    482
    Answers
    114
    Vote Rating
    55
      0  

    Default

    Also, if you try to add another item to the views array in your controller and bring up completions using ctrl-space, do your view classes appear in the popup menu?

  7. #6
    Sencha User Mark.Brocato's Avatar
    Join Date
    Mar 2015
    Location
    Maryland
    Posts
    482
    Answers
    114
    Vote Rating
    55
      0  

    Default

    Lastly, can you verify that you've got an app.json file in the same root folder as app.js. Does the app.json file have a name property? Would you be able to post it so I could take a look?

    If your app.json file is missing, you can just add a trivial one to make the plugin work properly. All it needs is something like:

    Code:
    { "name" : "MyAppName" }

  8. #7
    Sencha Premium User
    Join Date
    Jan 2013
    Posts
    62
    Answers
    2
    Vote Rating
    4
      0  

    Default

    Quote Originally Posted by Mark.Brocato View Post
    You only have to add a JavaScript library if the Ext JS source code is outside of your project. Just curious, is that actually the case? For apps built with cmd the Ext JS source is generally in an directory named "ext" which is a peer to the "app" directory.
    Yeah, we have a weird process where when we want to do a build, we copy over all the src files into the actual ext workspaces for sencha command and then run the sencha app build commands. This is so we can keep the src code seperate from all the sencha command build artifacts. Therefore I had to add the Javascript library.

  9. #8
    Sencha Premium User
    Join Date
    Jan 2013
    Posts
    62
    Answers
    2
    Vote Rating
    4
      0  

    Default

    Quote Originally Posted by Mark.Brocato View Post
    Lastly, can you verify that you've got an app.json file in the same root folder as app.js. Does the app.json file have a name property? Would you be able to post it so I could take a look?

    If your app.json file is missing, you can just add a trivial one to make the plugin work properly. All it needs is something like:

    Code:
    { "name" : "MyAppName" }
    Ah ok, looks like this was the issue. I didn't realize the app.json was required. When I copied it over to our "src" directory, it recognized all the views correctly. I assumed it would grab the app name from the "Application.js" file. All good now I think. Thanks!

  10. #9
    Sencha Premium User
    Join Date
    Jan 2013
    Posts
    62
    Answers
    2
    Vote Rating
    4
      0  

    Default

    Mark,
    Maybe I should start another post but it looks like the plugin doesn't catch out "common" code package. I assume this is because we would have to use Sencha CMD "packages" instead of using the workspace.classpath method that we currently use detailed here (http://docs.sencha.com/cmd/5.x/workspaces.html).

    For example, our app name = LDB but our common package code namespace is QLP. However there isn't anywhere in the app.json to put the "QLP" namespace.

    Thanks,
    Tim

Similar Threads

  1. Replies: 1
    Last Post: 28 Feb 2012, 5:59 PM
  2. MVC app listing all views, stores and models is unmanageable
    By jay@moduscreate.com in forum Sencha Touch 2.x: Bugs
    Replies: 8
    Last Post: 14 Feb 2012, 8:44 AM
  3. [FIXED] Controller MODELS / STORES / VIEWS new interface is broke
    By Artistan in forum Sencha Architect 2.x: Help & Discussions
    Replies: 3
    Last Post: 18 Jan 2012, 9:29 PM
  4. Replies: 0
    Last Post: 25 Aug 2011, 3:17 AM

Posting Permissions

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