1. #1
    Sencha User
    Join Date
    Nov 2012
    Posts
    83
    Vote Rating
    0
    koolll is on a distinguished road

      0  

    Default Unanswered: Not able to get store in formpanel

    Unanswered: Not able to get store in formpanel


    I has define store in sencha touch as follow:

    store.js


    Code:
          Ext.define('bluebutton.store.BlueButton.Testing', {
            extend: "Ext.data.Store",
            requires: [
                      'bluebutton.model.BlueButton.Testing'
            ],
            config: {
                storeId: 'testingstore',
                model: 'bluebutton.model.BlueButton.Testing'
            }
        });
    Model.js

    Code:
      Ext.define('bluebutton.model.BlueButton.Testing', {        extend: 'Ext.data.Model',
        
            requires: [
                     'Ext.data.proxy.LocalStorage'
            ],
        
            config: {
                fields: [
                    { name: 'first', type: 'string' },
                    { name: 'second', type: 'string' }
                ],
                proxy: {
                    type: 'localstorage',
                    id: '_codeAnalyzerLocalStorage'
                }
            }
        });
    I need to call getStore()
    Code:
            Ext.define('bluebutton.view.BlueButton.testing', {
            extend: 'Ext.form.Panel',
            xtype: 'testing',
               requires: [
          
            'bluebutton.view.BlueButton.TransactionList',
            'bluebutton.view.BlueButton.MemberPopUp',
             'bluebutton.view.BlueButton.MemberDetail',
             'bluebutton.store.BlueButton.MemberList',
        
             'bluebutton.model.BlueButton.Testing',
             'bluebutton.store.BlueButton.Testing'
        
        
        
               
            ],
          
            config: {
             id:'register',
                items :[
                   
                      {
                            xtype: 'textfield',
                            name: 'name',
                            label: 'Name'
                        },
                        {
                            xtype: 'emailfield',
                            name: 'email',
                            label: 'Email'
                        },
                      
                        
        
                        {
                            
                            xtype: 'button',
                            text: 'Test Local',
                             handler: function(button) {
                                
                               
                               var test =   Ext.getCmp('testingstore').getStore();   
                              
                               alert(test);
        
        
                                
        
                               
                               }
        
        
        
        
                        },
        
        
                        
        
                        
                        
                        
        
        
                ],
        
        
           }
        
        });
    But I get this error getStore is undefined .Please help. Thanks

  2. #2
    Sencha User
    Join Date
    May 2012
    Posts
    31
    Answers
    2
    Vote Rating
    1
    A.Tyshchyk is on a distinguished road

      0  

    Default


    If you want to get store by its id you should use StoreManager

    Code:
    Ext.data.StoreManager.get('testingstore')
    If you want to get component's store you must use component's id
    Code:
    Ext.getCmp('register').getStore();

Thread Participants: 1

Tags for this Thread

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