Page 1 of 2 12 LastLast
Results 1 to 10 of 12

Thread: Minify - select Field no class name when getting name by alias

  1. #1
    Sencha User
    Join Date
    Apr 2012
    Posts
    8
    Vote Rating
    0
      0  

    Default 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.



  2. #2
    Sencha - Sr Software Engineer mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    39,336
    Answers
    3885
    Vote Rating
    1297
      0  

    Default

    Did you require the select field class?
    Mitchell Simoens @LikelyMitch
    Sencha Inc, Senior Software Engineer
    ________________
    Learn BBCode and use it!

    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. #3
    Sencha User
    Join Date
    Apr 2012
    Posts
    8
    Vote Rating
    0
      0  

    Default

    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.

  4. #4
    Sencha - Sr Software Engineer mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    39,336
    Answers
    3885
    Vote Rating
    1297
      0  

    Default

    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_dependencies
    Mitchell Simoens @LikelyMitch
    Sencha Inc, Senior Software Engineer
    ________________
    Learn BBCode and use it!

    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. #5
    Sencha User
    Join Date
    Apr 2012
    Posts
    8
    Vote Rating
    0
      0  

    Default

    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?

  6. #6
    Sencha - Sr Software Engineer mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    39,336
    Answers
    3885
    Vote Rating
    1297
      0  

    Default

    In the class that requires the select field you need to use the requires array
    Mitchell Simoens @LikelyMitch
    Sencha Inc, Senior Software Engineer
    ________________
    Learn BBCode and use it!

    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. #7
    Sencha User
    Join Date
    Apr 2012
    Posts
    8
    Vote Rating
    0
      0  

    Default

    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?

  8. #8
    Sencha - Sr Software Engineer mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    39,336
    Answers
    3885
    Vote Rating
    1297
      0  

    Default

    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 @LikelyMitch
    Sencha Inc, Senior Software Engineer
    ________________
    Learn BBCode and use it!

    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. #9
    Sencha User
    Join Date
    Apr 2012
    Posts
    8
    Vote Rating
    0
      0  

    Default

    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' ],

  10. #10
    Sencha - Sr Software Engineer mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    39,336
    Answers
    3885
    Vote Rating
    1297
      0  

    Default

    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 @LikelyMitch
    Sencha Inc, Senior Software Engineer
    ________________
    Learn BBCode and use it!

    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.

Page 1 of 2 12 LastLast

Tags for this Thread

Posting Permissions

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