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 8977453
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T19:22:31+00:00 2026-06-15T19:22:31+00:00

I am trying to centralize my configuration of EXTJS stores within my application, however,

  • 0

I am trying to centralize my configuration of EXTJS stores within my application, however, I cannot seem to figure out how to make this happen. I am using ExtJS 4.1.

I have a base store, which I want to hold all of the repetitive configuration stuff, and then my more specific stores to hold what’s actually different.

Ext.define('My.store.Abstract', {
    extend: 'Ext.data.Store',
    autoload:false,
    proxy: {
        type: 'ajax', 
        reader: {  
            type: 'json',
            root: 'data',
            totalProperty: 'total',  
            successProperty: 'success', 
            messageProperty: 'message'  
        },
        writer: {  
            type: 'json',
            encode: true, 
            writeAllFields: true, 
            root: 'data',
            allowSingle: false 
        },
        simpleSortMode: true
    }
});

Then I would like to provide the store specific stuff on a store by store basis —

Ext.define('My.store.Products', {
    extend: 'My.store.Abstract',
    storeId: 'Products',
    model: 'My.model.Product',
    proxy: {
        api: {
            create: '/myurl/create',  
            read: '/myurl/index',
            update: '/myurl/update',  
            destroy: '/myurl/delete' 
        }
    }
});

What I am finding is that it just doesnt behave at all. I believe it has something to do with the proxy, but I just can’t track it down.

What is the correct way to do this? I would prefer not to replicate the same configuration stuff (from my abstract store) across the 350+ stores in my application. As of now, that it what I have, and I thought I was trying to implement a pretty basic concept .. to no avail.

I know things are not working, as basic as the pageSize, or even the autoLoad .. because they are not being respected at all.

I’ve played around with constructors, and calling the parent.

Any help would be greatly appreciated.

  • 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-06-15T19:22:32+00:00Added an answer on June 15, 2026 at 7:22 pm

    You can’t do it that way because you’re expecting to to merge the objects which it just won’t do.

    Instead, you’ll want to look at something like this (untested):

    Ext.define('Base', {
        extend: 'Ext.data.Store',
    
        autoLoad: false,
    
        constructor: function(config) {
            // applyIf means only copy if it doesn't exist
            Ext.applyIf(config, {
                proxy: this.createProxy()
            });
            this.callParent([config]);
        },
    
        createProxy: function() {
            return {
                reader: {
                    type: 'json',
                    root: 'data',
                    totalProperty: 'total',
                    successProperty: 'success',
                    messageProperty: 'message'
                },
                writer: {
                    type: 'json',
                    encode: true,
                    writeAllFields: true,
                    root: 'data',
                    allowSingle: false
                },
                simpleSortMode: true
            }
        }
    });
    
    Ext.define('Sub', {
        extend: 'Base',
    
        createProxy: function(){
            var proxy = this.callParent();
            proxy.api = {
                create: 'create',
                update: 'update'
            };
    
            return proxy;
        }
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Trying to figure out how I can do this properly. The print_r looks like
trying to figure out why this is happening - I have an input text
I'm trying to figure out how to centralize a method that I use in
Trying to make this jQuery filter that uses .find case-insensitive. For example, when the
I need to centralize authentication to my rest web services and make this authentication
In a C++ multi-threaded application with many classes, i am trying to find out
Trying to make this test to fail without success. I've got this HTML: <div
I am trying to centralize Core Data calls for each Core Data entity into
Trying to build out an exception if move.UserId does not equal currentUserId then Redirect
I'm wondering how others deal with trying to centralize MessageBox function calling. Instead of

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.