Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6213937
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T06:47:14+00:00 2026-05-24T06:47:14+00:00

So I have two stores that use the exact same model, they are exactly

  • 0

So I have two stores that use the exact same model, they are exactly the same in every way (except for their names of course). I want two different stores.

app.stores.newsFeed = new Ext.data.Store({
   model: 'app.models.feedData',
   proxy: {
      type: 'scripttag',
      url: 'http://query.yahooapis.com/v1/public/yql',
      extraParams: {
        format: 'json'
    },
    reader: {
        root: 'query.results.item'
    }
  } 
});

app.stores.eventsFeed = new Ext.data.Store({
   model: 'app.models.feedData',
   proxy: {
      type: 'scripttag',
      url: 'http://query.yahooapis.com/v1/public/yql',
      extraParams: {
        format: 'json'
    },
    reader: {
        root: 'query.results.item'
    }
}
});

My question is can I save space by getting rid of code and use only one store instance so I don’t have to re-declare another new Ext.data.Store again?

something like:

store = new Ext.data.Store(...);
app.stores.newsFeed = store;
app.stores.eventsFeed = store;

I tried this before but both were assigned to the same store so when one was changed so was the other.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-24T06:47:16+00:00Added an answer on May 24, 2026 at 6:47 am

    Just extend extJS component and you can get fast instances of your component:

    MyStore = Ext.extend(Ext.data.Store, {
        constructor : function(config) {
            config = Ext.apply({
                model: 'app.models.feedData',
                proxy: {
                    type: 'scripttag',
                    url: 'http://query.yahooapis.com/v1/public/yql',
                    extraParams: {
                         format: 'json'
                    },
                    reader: {
                         root: 'query.results.item'
                    }
                } 
            }, config);                 
            MyStore.superclass.constructor.call(this, config);
        }, 
    
        onDestroy : function(config) {
            MyStore.superclass.onDestroy.apply(this, arguments);
        }
    });
    

    And create as much independent instanses as you want:

    app.stores.newsFeed = Ext.create(MyStore, {});
    app.stores.eventsFeed = Ext.create(MyStore, {});
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have two tables, one that stores user earnings and another that stores the
I have two applications running in the same java virtual machine, and both use
I have two tables which have the exact same structure. Both tables can store
I have two database tables. One table stores data for a commitment that a
I have a Perl program that stores regular expressions in configuration files. They are
I have a stored procedure that returns two int Values. The first can not
I have a stored procedure that takes no parameters, and it returns two fields.
I have two tables, one stores the products and quantity we have bought, the
I have two models: Person and Relation. The second one stores information about relations
In my program I have two classes: Collector and Entity. Collector stores Entities in

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.