1. #131
    Sencha User
    Join Date
    Dec 2009
    Posts
    52
    Vote Rating
    6
    TonyBones is on a distinguished road

      0  

    Default


    UPDATE: Oh brother! I had xtype: 'grid' in my view and totally forgot. That's what was causing the issue! I changed it to 'touchgridpanel' and its working. But still curious to know why I had to install the files in the SDK folders instead of my custom scripts folder?


    So I'm a little confused as to how to even "install" this and begin using it.

    I just download Sencha Touch 2 yesterday for the first time. And I pulled this addon from github. I just can't figure out how to get it installed and working.

    I add this to my app.json file:
    Code:
            {
                "path": "scripts/grid/feature/Feature.js"
            },
            {
                "path": "scripts/grid/feature/Abstract.js"
            },
            {
                "path": "scripts/grid/feature/Editable.js"
            },
            {
                "path": "scripts/grid/feature/Paging.js"
            },
            {
                "path": "scripts/grid/feature/Sorter.js"
            },
            {
                "path": "scripts/grid/View.js"
            }
    
    ...
    //for css
            {
                "path": "resources/css/Ext.ux.grid.View.css"
            }
    And when I refresh my project in Chrome I get JS error:
    Code:
    sencha-touch.js:7665GET http://localhost/sammspad/sdk/src/ux/touch/grid/feature/Feature.js?_dc=1336153714900 404 (Not Found)
    
    
    sencha-touch.js:8007Uncaught Error: [Ext.Loader] Failed loading 'http://localhost/sammspad/sdk/src/ux/touch/grid/feature/Feature.js', please verify that the file exists
    
    
    sencha-touch.js:6357Uncaught Error: [Ext.createByAlias] Cannot create an instance of unrecognized alias: widget.grid
    Why is it looking in the SDK location? The Network tab in Chrome dev tool shows the files being download successfully from my "scripts" directory. Why is it trying to download it twice?

    Thanks for any help,
    Tony

    EDIT: Side note, I did move the files from my scripts dir into the sdk location and while the first 2 errors above do go away I'm still left with the third error about "widget.grid" and the app still bombs out, stuck at the loading screen.

    EDIT: I inspected the this.map.aliasToName collection and there (obviously) is no "widget.grid" entry. But there is a widget.touchgridpanel: "Ext.ux.touch.grid.View" entry. Any idea what's going on here? I searched for "widget.grid" string in source code and can't find it.
    Last edited by TonyBones; 4 May 2012 at 10:32 AM. Reason: updating progress

  2. #132
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    37,549
    Vote Rating
    873
    mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute

      0  

    Default


    Look at the demos, notice how they require other classes which is how the files are loaded. You should not put them in app.json. Also note you have to setup a path for Ext.ux
    Mitchell Simoens @SenchaMitch
    Sencha Inc, Senior Forum Manager
    ________________
    Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
    https://github.com/mitchellsimoens

    Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/

    Need more help with your app? Hire Sencha Services services@sencha.com

    Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is in print!

    When posting code, please use BBCode's CODE tags.

  3. #133
    Sencha User
    Join Date
    Dec 2009
    Posts
    52
    Vote Rating
    6
    TonyBones is on a distinguished road

      0  

    Default


    Quote Originally Posted by mitchellsimoens View Post
    Look at the demos, notice how they require other classes which is how the files are loaded. You should not put them in app.json. Also note you have to setup a path for Ext.ux
    I have been looking at the demos, and since I'm new to Sencha Touch as of 1 day, I'm still trying to figure it all out.

    I used 'sencha generate' command to start a new project and what it makes is very different then your examples. So i'm confused as to which approach to use and how they can be used together. Also I thought using the app.json file was the preferred way???

    thanks!

  4. #134
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    37,549
    Vote Rating
    873
    mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute

      0  

    Default


    My demos aren't MVC, they are a "get your feet wet" demo. Using the requires is the way to load classes during development, you shouldn't add them to app.json. You should only add external files to the app.json, anything built with ST2 should be required.
    Mitchell Simoens @SenchaMitch
    Sencha Inc, Senior Forum Manager
    ________________
    Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
    https://github.com/mitchellsimoens

    Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/

    Need more help with your app? Hire Sencha Services services@sencha.com

    Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is in print!

    When posting code, please use BBCode's CODE tags.

  5. #135
    Sencha User
    Join Date
    Dec 2009
    Posts
    52
    Vote Rating
    6
    TonyBones is on a distinguished road

      0  

    Default


    So your saying your files aren't external files, and they should be copied into the sdk/src folders?

  6. #136
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    37,549
    Vote Rating
    873
    mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute

      0  

    Default


    My files are made with Sencha Touch so they aren't external. You should not mess with the src folder, you should have the grid stuff in a new folder maybe in assets/ux/ or something. Then add a path to Ext.Loader so that Ext.ux points to assets/ux/ like the demos do.
    Mitchell Simoens @SenchaMitch
    Sencha Inc, Senior Forum Manager
    ________________
    Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
    https://github.com/mitchellsimoens

    Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/

    Need more help with your app? Hire Sencha Services services@sencha.com

    Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is in print!

    When posting code, please use BBCode's CODE tags.

  7. #137
    Sencha User
    Join Date
    Dec 2009
    Posts
    52
    Vote Rating
    6
    TonyBones is on a distinguished road

      0  

    Default


    ok, that's what I though, as I didn't want them in there anyway. But for some reason if they are not in there I keep getting:

    Code:
    GET http://localhost/sammspad/sdk/src/ux/touch/grid/View.js?_dc=1336158635376 404 (Not Found)
    At the top of my View:
    Code:
    Ext.Loader.setConfig({
        enabled: true,
        paths: {
            'Ext.ux.touch.grid': './scripts/grid'
        }
    });
    And the View.js file is in that directory with all other js files in the sub dir of "feature".

    So not sure what the problem is, do you?

    Solved: I still had requires in the app.js file. When I removed it there and put it directly in the view then the correct files loaded.

  8. #138
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    37,549
    Vote Rating
    873
    mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute

      0  

    Default


    When are you requiring the view versus setting the path?
    Mitchell Simoens @SenchaMitch
    Sencha Inc, Senior Forum Manager
    ________________
    Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
    https://github.com/mitchellsimoens

    Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/

    Need more help with your app? Hire Sencha Services services@sencha.com

    Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is in print!

    When posting code, please use BBCode's CODE tags.

  9. #139
    Sencha User
    Join Date
    Dec 2009
    Posts
    52
    Vote Rating
    6
    TonyBones is on a distinguished road

      0  

    Default


    Now I'm getting this again:
    Code:
    Uncaught Error: [Ext.createByAlias] Cannot create an instance of unrecognized alias: widget.touchgridpanel
    All files are being downloaded to browser. And I debugged and that widget line is def not in the alias collection.

    My view looks like this:
    Code:
    Ext.Loader.setConfig({
        enabled: true,
        paths: {
            'Ext.ux': './scripts/ux'
        }
    });
    
    
    Ext.require([
        'Ext.Img',
        'Ext.ux.touch.grid.View',
        'Ext.ux.touch.grid.feature.Feature',
        'Ext.ux.touch.grid.feature.Sorter'
    ]);
    
    
    
    
    Ext.define("SammsPad.view.Main", {
        extend: 'Ext.tab.Panel',
        requires: [
            'Ext.TitleBar'
        ],
        config: {
            tabBarPosition: 'bottom',
    
    
            items: [
                            ...
                            { xtype: 'touchgridpanel' }
                            ...
                   ]
              }
    });

  10. #140
    Sencha User
    Join Date
    Dec 2009
    Posts
    52
    Vote Rating
    6
    TonyBones is on a distinguished road

      0  

    Default


    Don't know what happened, but now its working. Maybe I didn't hard refresh. Thanks for your help mitchellsimoens!!!