1. #1
    Sencha User
    Join Date
    Aug 2012
    Posts
    6
    Vote Rating
    0
    redjetfire is on a distinguished road

      0  

    Default Answered: Working with two Stores

    Answered: Working with two Stores


    PHP Code:
    viewMyTeam: function() {
            var 
    store this.getUsersStore();
                
    store.clearFilter(true);
            var 
    teamstore this.getTeamsStore();
                
    teamstore.clearFilter(true);
                var 
    teamdata;
                 var 
    data;
                var 
    user Ext.getCmp('profStatus').getText();
                
    data store.getAt(store.findExact('login'user.toLowerCase())).data;
                if(
    data.team != "")
                {
                    var 
    win Ext.widget('teamview');
                    
    teamdata teamstore.getAt(teamstore.findExact('id'data.team)).data;
                    var 
    team Ext.getCmp('team_name');
                    
    team.setText(teamdata.teamname.toUpperCase() + " Team");
                    var 
    Ext.getCmp('team_info').down('displayfield');
                    
    a.setValue(teamdata.teamleader.toUpperCase());
                    
    a.next('displayfield').setValue(teamdata.t);
                    var 
    teamcount store.filter('team'teamdata.idtrue);
                    var 
    qwerty store.getCount();
                    
    a.next('displayfield').setValue(qwerty);
                    
    win.down('form');
            } 
    teamdata = teamstore.getAt(teamstore.findExact('id', data.team)).data;

    Any one can told me why teamdata is undefined?

    Thnx

  2. Separate your code and find out what is not resolving.

    ex:
    Code:
    var index = teamstore.findExact('id', data.team);
    var record = teamstore.getAt(index);
    console.log(record);

    Scott.

  3. #2
    Sencha - Support Team scottmartin's Avatar
    Join Date
    Jul 2010
    Location
    Houston, Tx
    Posts
    9,083
    Answers
    675
    Vote Rating
    467
    scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future

      0  

    Default


    Separate your code and find out what is not resolving.

    ex:
    Code:
    var index = teamstore.findExact('id', data.team);
    var record = teamstore.getAt(index);
    console.log(record);

    Scott.

Thread Participants: 1

Tags for this Thread