Hybrid View

  1. #1
    Sencha User
    Join Date
    Nov 2012
    Posts
    4
    Vote Rating
    2
    tonyhansen is on a distinguished road

      0  

    Default n00b question: how to add to Ex.application "requires" section?

    n00b question: how to add to Ex.application "requires" section?


    Hi All,

    So I've followed the "First Touch Application" tutorial, and get pretty much nothing on screen, other than the header.

    Chrome reports this error:

    "Uncaught TypeError: Cannot call method 'setStore' of undefined"

    Comparing my work to the "CityBars670" sample download, I see the sample has this section under the code for "Application":

    <snip>

    Ext.Loader.setConfig({
    enabled: true
    });Ext.application({
    requires: [
    'Ext.dataview.List',
    'Ext.data.proxy.JsonP'
    ],

    models: [
    'Business'
    ],
    </snip>

    whereas my app is missing that.

    I can't simply type it in to add it ... can someone please tell me, step by step, how I go about adding this "requires" section to my app?

    Sorry if this is a complete n00b question ... learning this stuff at 5am, so maybe my head isn't screwed on properly ;-)

    Thanks!

    T

  2. #2
    Sencha - Architect Dev Team aconran's Avatar
    Join Date
    Mar 2007
    Posts
    9,445
    Vote Rating
    129
    aconran is a splendid one to behold aconran is a splendid one to behold aconran is a splendid one to behold aconran is a splendid one to behold aconran is a splendid one to behold aconran is a splendid one to behold aconran is a splendid one to behold

      0  

    Default


    Click the application node in the inspector; in the configuration grid at the bottom right search for "requires" then add any particular requires you want.
    Aaron Conran
    @aconran
    Sencha Architect Development Team

  3. #3
    Sencha User
    Join Date
    Nov 2012
    Posts
    4
    Vote Rating
    2
    tonyhansen is on a distinguished road

      1  

    Default


    Thanks so much for that Aaron.

    I was sure I had tried that, but the filter wasn't returning the "requires" configuration item. Obviously I was doing something wrong ... probably had the wrong item selected in the Inspector.

    All fixed now. Ended up getting my version of the CityBars sample project up and running, after a few more fixes related to id casings, so all good!

    Thanks!

    T

  4. #4
    Sencha User
    Join Date
    Nov 2012
    Posts
    4
    Vote Rating
    2
    tonyhansen is on a distinguished road

      1  

    Default


    One more question on this subject ... how would I know what/when to add to the "requires" section?

    There's nothing about modifying that section in the walkthrough for the CityBars sample application ... if it wasn't for doing a line-by-line comparison to the existing working demo download, I never would have realised I needed those entries.

    I had assumed that by adding the components to the designer surface, the necessary "requires" would be automagically populated. Not the case?

    Thanks

    T

  5. #5
    Touch Premium Member BostonMerlin's Avatar
    Join Date
    Aug 2010
    Location
    Boston
    Posts
    523
    Vote Rating
    43
    BostonMerlin is a jewel in the rough BostonMerlin is a jewel in the rough BostonMerlin is a jewel in the rough

      0  

    Default


    Requires are typically added automatically. Sometimes this doesn't always work though.

  6. #6
    Sencha User
    Join Date
    Nov 2012
    Posts
    4
    Vote Rating
    2
    tonyhansen is on a distinguished road

      0  

    Default


    Cheers mate.

    Is there a list/guide somewhere, that says "if you use THIS component, then you should have THIS requires"? In case another "doesn't always work" situation arises?

    I'm flying blind ... if this hadn't been demo code that I could compare to a pre-built example, I would have been buggered trying to work out what the problem was.