Results 1 to 2 of 2

Thread: Calling isValid() on a Model throws an error in Modern Production build

    Looks like we can't reproduce the issue or there's a problem in the test case provided.
  1. #1
    Sencha User
    Join Date
    Dec 2014
    Posts
    11

    Default Calling isValid() on a Model throws an error in Modern Production build

    Code:
    //The Model
    Ext.define(MyApp.model.UserLogin', {
        extend: 'Ext.data.Model',
        requires: [],
    
        fields: [
            {name: 'userId', type: 'string'},
            {name: 'password', type: 'string'}
        ],
        validators: {
            userId: [
                {type: 'email', message: "Wrong Email Format"},
                {type: 'presence'}
            ],
            password: [
                {type: 'length', min: 4},
                {type: 'presence'}
            ]
        },
        proxy: {
          ...
        }
    });
    Code:
    //In the app
    var user = Ext.create('MyApp.model.UserLogin', {
                userId: fields.user,
                password: fields.password
            });
    
    
            if (user.isValid()) { *****      
                ...
            }
            else {
                ...
            }
    ***** This line throws "Uncaught TypeError: c is not a function"

    I made sure that userId and password had valid values.

  2. #2
    Sencha User
    Join Date
    Dec 2014
    Posts
    11

    Default

    Solution found:

    It seems that I have to require ['Ext.data.validator.Email', 'Ext.data.validator.Presence', 'Ext.data.validator.Length'] when using the testing/production builds.

Similar Threads

  1. Replies: 4
    Last Post: 20 Nov 2014, 8:24 AM
  2. [FIXED] Calling reconfigure() on Ext.tree.Panel throws error
    By sraghura201 in forum Ext:Bugs
    Replies: 9
    Last Post: 11 Feb 2014, 6:19 AM
  3. Replies: 3
    Last Post: 19 Nov 2013, 3:24 PM
  4. Syntax error in production build, no error in testing build
    By antun in forum Sencha Touch 2.x: Q&A
    Replies: 3
    Last Post: 19 Nov 2012, 12:44 PM
  5. Heroku Build throws error
    By vganeshbabu in forum Sencha Touch 2.x: Q&A
    Replies: 2
    Last Post: 10 Apr 2012, 11:52 AM

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
  •