-
11 Jun 2012 10:24 AM #1
Unanswered: Minify - select Field no class name when getting name by alias
Unanswered: Minify - select Field no class name when getting name by alias
We are trying to minify our sencha 2 touch application. We used the command line tool (sencha app build production) and now see we have a new sdk folder, new app.js file and some other changes. When I takes these new files and put them on our web server and run our application I am able to get to our login view. When I put in a username and password and click on our Login button we get this error. 'Uncaught TypeError: Cannot call method 'substring' of undefined' when I go into chrome's developer app and set break points I am finding that my select field
xtype: 'selectfield', cls: 'fieldSetFontClass', name: 'district', id: 'district', label: 'District', placeHolder: 'Click to Select District', listeners: { change: function (control, newValue, oldValue, eOpts) { DistrictChange(newValue); } }
is not getting a namespace back.
It takes the argument of widget.selectfield and gets the classname by alias.
The class name is "" when returned.
When this classname is an empty string I get this error.
-
15 Jun 2012 11:53 AM #2Sencha - Senior Forum Manager
- Join Date
- Mar 2007
- Location
- St. Louis, MO
- Posts
- 33,599
- Vote Rating
- 435
- Answers
- 3102
Did you require the select field class?
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.
-
15 Jun 2012 11:56 AM #3
thank you so much for the reply and I have seen your picture on this forum quite a bit - so you must be the resident expert.
I am not following your response though - i have not omitted any of the css classes through the minification.
-
15 Jun 2012 12:00 PM #4Sencha - Senior Forum Manager
- Join Date
- Mar 2007
- Location
- St. Louis, MO
- Posts
- 33,599
- Vote Rating
- 435
- Answers
- 3102
This isn't for CSS, this is for the Sencha Touch 2 class. The whole build process binds on the fact that your classes require the classes that it uses to do a build.
Some of our guides may help you understand this concept like this one: http://docs.sencha.com/touch/2-0/#!/...c_dependenciesMitchell 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.
-
15 Jun 2012 12:08 PM #5
this is what i have in my app.js file
requires: [ 'Ext.MessageBox' ], models: [ 'Districts' ], views: ['Main', 'Login', 'Search'], stores: [ 'DistrictStore' ],guessing you are saying that i need some other tools in the requires array?
-
15 Jun 2012 12:10 PM #6Sencha - Senior Forum Manager
- Join Date
- Mar 2007
- Location
- St. Louis, MO
- Posts
- 33,599
- Vote Rating
- 435
- Answers
- 3102
In the class that requires the select field you need to use the requires array
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.
-
15 Jun 2012 12:11 PM #7
Sorry for the beginner questions - when you say class - are you talking about my specific js file or in this app.js file in the requires section - im gussing you mean in my specific js file that uses this control?
-
15 Jun 2012 12:23 PM #8Sencha - Senior Forum Manager
- Join Date
- Mar 2007
- Location
- St. Louis, MO
- Posts
- 33,599
- Vote Rating
- 435
- Answers
- 3102
When you use Ext.define, you are creating a class, technically a class definition.
When you create an instance using Ext.create or the new keyword, that is a class instance.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.
-
15 Jun 2012 12:26 PM #9
this is how the beginning of my js file now looks
Ext.define('MyApp.view.Search', { extend: 'Ext.Panel', fullscreen: true, layout: 'fit', id: 'searchForm', requires: [ 'Ext.field.Search' ],
-
15 Jun 2012 12:30 PM #10Sencha - Senior Forum Manager
- Join Date
- Mar 2007
- Location
- St. Louis, MO
- Posts
- 33,599
- Vote Rating
- 435
- Answers
- 3102
Right, so that MyApp.view.Search class is requiring Ext.field.Search field. Wherever you use the select field that class needs to require the Ext.field.Select just like you did with Ext.field.Search.
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.


Reply With Quote