Results 1 to 4 of 4

Thread: Auto Getters and Setters undefined when accessing class instance for Ext.Base

  1. #1
    Sencha User
    Join Date
    Oct 2012
    Posts
    18

    Default Answered: Auto Getters and Setters undefined when accessing class instance for Ext.Base

    Hi guys,
    I am migrating from Sencha Touch to Ext.js 4.2.1 and I can't seem to get the following to work. I know that in the docs, this is documented as working, but again, can't seem to get it to work... I have the following test case:

    PHP Code:
    Ext.define('MyApp.view.TestClass', {    
        
    extend'Ext.Base',
        
    testProperty'test',
        
    constructor: function(config) {        
            
    this.initConfig(config);
        }
    }); 
    I then execute the following code:

    PHP Code:
    var testClass Ext.create('MyApp.view.TestClass'
    {
        
    testProperty"HELLO!!!"
    }, Ext.emptyFn);
    console.log(testClass.getTestProperty()); 
    I get the following error:

    TypeError: Object [object Object] has no method 'getTestProperty'

    Is there anything I am doing wrong?

  2. In your class definition, you need to wrap the "testProperty" inside a "config" block. Here's an example:


  3. #2
    Ext JS Premium Member burnnat's Avatar
    Join Date
    Jun 2011
    Posts
    418
    Answers
    42

    Default

    In your class definition, you need to wrap the "testProperty" inside a "config" block. Here's an example:


  4. #3
    Sencha User
    Join Date
    Sep 2013
    Posts
    30
    Answers
    1

    Default

    I'm using Architect 3.0.0.1318 and I can't seem to modify my config to get the properties without doing an override. Is there no way to do this without an override?

  5. #4
    Sencha User
    Join Date
    Oct 2012
    Posts
    18

    Default

    Thanks. My problem seems to be stemming from using Architect 3 to generate these custom properties. I have re-asked the question in the Architect 3.x forum. http://www.sencha.com/forum/showthre...25#post1011625

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
  •