Results 1 to 2 of 2

Thread: New list displaying data from previously destroyed list

  1. #1
    Touch Premium Member
    Join Date
    Aug 2011
    Vote Rating

    Default 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.

           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("")

    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 - Sr Software Engineer mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Gainesville, FL
    Vote Rating


    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:

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

    Ext.define('....', {
        extend : '',
        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 @LikelyMitch
    Sencha Inc, Senior Software Engineer
    Learn BBCode and use it!

    Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2

    Think my support is good? Get more personalized support via a support subscription.

    Need more help with your app? Hire Sencha Services

    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.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts