1. #1
    Touch Premium Member
    Join Date
    Aug 2011
    Location
    Arkansas
    Posts
    18
    Vote Rating
    0
    Digitalis is on a distinguished road

      0  

    Default Unanswered: New list displaying data from previously destroyed list

    Unanswered: New list displaying data from previously destroyed list


    In my application I have a tab panel with a few lists each bound to JSON stores. When the user clicks a logout button the navigation view (which contains the tab panel) is destroyed and another user can login. I can confirm that the lists are destroyed on logout because Ext.ComponenyQuery.query('list') returns empty.

    Code:
         
           logoutButton: {           
                  tap: function () {
                        Ext.Msg.confirm('Logout', 'Are you sure you want to logout?', function (button) {
                            if (button == "yes") {
                                this.getMainViewport().remove(this.getNavView(), true);
                            }
                        }, this);
                    }
                },
    When another user logs in and the tab panel is displayed, the lists have the previous data. The stores for each list are created in the config of the list view:
    store: Ext.create("MyApp.store.AJsonStore")

    Since the lists are destroyed and I create the store in the config of the list, I assume everything is "cleared out" and I start fresh each time. But somehow the list is retaining the data.

    I call getStore().load() on the list when it is first shown, so this isn't a huge problem, but the old data is there for a second while the new data loads. What is going on?

  2. #2
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    35,704
    Answers
    3356
    Vote Rating
    751
    mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute

      0  

    Default


    You shouldn't use Ext.create in the config like that, that store will remain alive and used for any instance. You should do this:

    Code:
    config : {
        ...
        store : { type : 'mystoretype' }
    }
    And on your store:

    Code:
    Ext.define('....', {
        extend : 'Ext.data.Store',
        alias  : 'store.mystoretype',
    
        ....
    });
    Notice in red the linking between the list's store config and the store's type. Now, the only thing that *should* be able to trip this up is if you define a storeId on the store, don't do that.
    Mitchell Simoens @SenchaMitch
    Sencha Inc, Senior Forum Manager
    ________________
    Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
    https://github.com/mitchellsimoens

    Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/

    Need more help with your app? Hire Sencha Services services@sencha.com

    Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is in print!

    When posting code, please use BBCode's CODE tags.

Thread Participants: 1

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