-
4 May 2012 9:58 AM #131
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:
And when I refresh my project in Chrome I get JS error: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" }
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?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
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
-
4 May 2012 10:38 AM #132Sencha - Senior Forum Manager
- Join Date
- Mar 2007
- Location
- St. Louis, MO
- Posts
- 33,714
- Vote Rating
- 436
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
________________
http://www.JSONPLint.com - Source to lint your JSONP!
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 almost in print!
When posting code, please use BBCode's CODE tags.
-
4 May 2012 10:42 AM #133
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 May 2012 10:44 AM #134Sencha - Senior Forum Manager
- Join Date
- Mar 2007
- Location
- St. Louis, MO
- Posts
- 33,714
- Vote Rating
- 436
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
________________
http://www.JSONPLint.com - Source to lint your JSONP!
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 almost in print!
When posting code, please use BBCode's CODE tags.
-
4 May 2012 11:03 AM #135
So your saying your files aren't external files, and they should be copied into the sdk/src folders?
-
4 May 2012 11:07 AM #136Sencha - Senior Forum Manager
- Join Date
- Mar 2007
- Location
- St. Louis, MO
- Posts
- 33,714
- Vote Rating
- 436
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
________________
http://www.JSONPLint.com - Source to lint your JSONP!
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 almost in print!
When posting code, please use BBCode's CODE tags.
-
4 May 2012 11:14 AM #137
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:
At the top of my View:Code:GET http://localhost/sammspad/sdk/src/ux/touch/grid/View.js?_dc=1336158635376 404 (Not Found)
And the View.js file is in that directory with all other js files in the sub dir of "feature".Code:Ext.Loader.setConfig({ enabled: true, paths: { 'Ext.ux.touch.grid': './scripts/grid' } });
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.
-
4 May 2012 11:17 AM #138Sencha - Senior Forum Manager
- Join Date
- Mar 2007
- Location
- St. Louis, MO
- Posts
- 33,714
- Vote Rating
- 436
When are you requiring the view versus setting the path?
Mitchell Simoens @SenchaMitch
Sencha Inc, Senior Forum Manager
________________
http://www.JSONPLint.com - Source to lint your JSONP!
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 almost in print!
When posting code, please use BBCode's CODE tags.
-
4 May 2012 11:28 AM #139
Now I'm getting this again:
All files are being downloaded to browser. And I debugged and that widget line is def not in the alias collection.Code:Uncaught Error: [Ext.createByAlias] Cannot create an instance of unrecognized alias: widget.touchgridpanel
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' } ... ] } });
-
4 May 2012 11:34 AM #140
Don't know what happened, but now its working. Maybe I didn't hard refresh. Thanks for your help mitchellsimoens!!!


Reply With Quote