1. #1
    Sencha User
    Join Date
    Nov 2011
    Posts
    4
    Vote Rating
    0
    no0b is on a distinguished road

      0  

    Default Unanswered: Cannot call method 'getProxy' of undefined

    Unanswered: Cannot call method 'getProxy' of undefined


    I started with this example: http://www.sencha.com/blog/using-ext...ur-application
    What I want is to change the "on-script" data from grid with another data from my database. For this, I did the following changes:

    Code:
    Ext.define('Elearning.stores.UserStore', {
        extend    : 'Ext.data.Store',
        requires  : ['Elearning.models.UserModel'],
    	storeId   : 'usersStore', 
    
    
        model     : 'Elearning.models.UserModel',
        proxy: {
            type: 'ajax',
            url : '/data/getUsers.php',
    		reader: {
    			type: 'json',
    			root: 'users'
    		}	
        },
    	autoLoad: true,
    	
        constructor : function() {
            this.callParent(arguments);
        }
    });
    I also edited the file UsersGridPanel.js
    Code:
    Ext.define('Elearning.views.UsersGridPanel', {
        extend   : 'Ext.grid.Panel',
        alias    : 'widget.UsersGridPanel',
        requires : ['Elearning.stores.UserStore'],
    
    
        initComponent : function() {
            this.store   = Elearning.stores.UserStore;
            this.columns = this.buildColumns();
            this.callParent();
        },
        buildColumns : function() {
            return [
                {
                    header    : 'First Name',
                    dataIndex : 'nume',
                    width     : 70
                },
                {
                    header    : 'Last Name',
                    dataIndex : 'prenume',
                    width     : 70
                },
                {
                    header    : 'Email',
                    dataIndex : 'email',
                    width     : 70
                },
                {
                    header    : 'Username',
                    dataIndex : 'username',
                    width     : 70
                }
            ];
        }
    });
    Unfortunately, I got an error (on Chrome console) at the red line described below with the error message Cannot call method 'getProxy' of undefined
    Code:
        initComponent : function() {
            this.store   = Elearning.stores.UserStore;
            this.columns = this.buildColumns();
            this.callParent();
        },
    Thanks in advance.

  2. #2
    Sencha User
    Join Date
    May 2011
    Location
    Ukraine, Rivne
    Posts
    247
    Answers
    44
    Vote Rating
    42
    redraid has a spectacular aura about redraid has a spectacular aura about redraid has a spectacular aura about

      0  

    Default


    PHP Code:
        initComponent : function() {
            
    this.store   Ext.create('Elearning.stores.UserStore');
    // or:
    //        this.store   = 'Elearning.stores.UserStore';
            
    this.columns this.buildColumns();
            
    this.callParent(arguments);
        }, 

  3. #3
    Sencha User
    Join Date
    Nov 2011
    Posts
    4
    Vote Rating
    0
    no0b is on a distinguished road

      0  

    Default


    It works and..hard to be a ...noob!

    Thanks!

    Quote Originally Posted by redraid View Post
    PHP Code:
        initComponent : function() {
            
    this.store   Ext.create('Elearning.stores.UserStore');
    // or:
    //        this.store   = 'Elearning.stores.UserStore';
            
    this.columns this.buildColumns();
            
    this.callParent(arguments);
        }, 

  4. #4
    Sencha User
    Join Date
    Jun 2013
    Posts
    2
    Vote Rating
    0
    alukic is on a distinguished road

      0  

    Default Thank you

    Thank you


    I had the same problem, and this resolved it. Thank you! If anyone can explain why this works:

    this
    .store = Ext.create('Elearning.stores.UserStore');

    and this does not:


    this.store = 'Elearning.stores.UserStore';

  5. #5
    Sencha User Tim Toady's Avatar
    Join Date
    Feb 2010
    Location
    Pennsylvania
    Posts
    536
    Answers
    61
    Vote Rating
    70
    Tim Toady is a jewel in the rough Tim Toady is a jewel in the rough Tim Toady is a jewel in the rough Tim Toady is a jewel in the rough

      0  

    Default


    Because the store config property must be in an instance of the store or the storeId of a store registered with StoreManager. The code specified in the first post has the storeId 'usersStore'. Personally, I would just let the controller create the store for me, not specify a storeId, and use 'UserStore' .

  6. #6
    Sencha User
    Join Date
    Jun 2013
    Posts
    2
    Vote Rating
    0
    alukic is on a distinguished road

      0  

    Default Thank you

    Thank you


    Thanks Tim.

Turkiyenin en sevilen filmlerinin yer aldigi xnxx internet sitemiz olan ve porn sex tarzi bir site olan mobil porno izle sitemiz gercekten dillere destan bir durumda herkesin sevdigi bir site olarak tarihe gececege benziyor. Sitenin en belirgin ozelliklerinden birisi de Turkiyede gercekten kaliteli ve muntazam, duzenli porno izle siteleri olmamasidir. Bu yuzden iste. Ayrica en net goruntu kalitesine sahip adresinde yayinlanmaktadir. Mesela diğer sitelerimizden bahsedecek olursak, en iyi hd porno video arşivine sahip bir siteyiz. "The Best anal porn videos and slut anus, big asses movies set..." hd porno faketaxi