ExtJS 5 share code (views/controllers/etc) between applications?

We are embarking on our second ExtJs 5 application and would like to share code from the first application. Each application will have a seperate MVC structure. I would like to create something like a "common" app that can be reused between the other applications.

What is the preferred way to do this in ExtJS 5?

NOTE: We use Maven as our build tool and do not want a solution that requires Sencha Cmd.

Answers:

Answer

After 2 days of reading the internet and extjs sources, I believe I have found a way to do this. Most of the credit goes to this answer here.

Bottom line is I put my common ExtJS javascript files in their own directory and instructed the loader where to find them based on a "fake" application name of "common":

Ext.Loader.setConfig({
    enabled : true, // Enable dynamic class loading (should be disabled later for production)
    'disableCaching' : true,
    paths : {
        'common' : '../common' 
    }
});

The advantages of this are that I can use URLs within Spring Security to control access and continue to utilize Eclipse's ability to update a running servlet dynamically whenever I change a javascript file.

Tags

Recent Questions

Top Questions

Home Tags Terms of Service Privacy Policy DMCA Contact Us

©2020 All rights reserved.