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
    41
    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
    534
    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.

film izle

hd film izle

film sitesi

takipci kazanma sitesi

takipci kazanma sitesi

güzel olan herşey

takipci alma sitesi

komik eğlenceli videolar