1

This is my folder structure:

  • app (folder)
    • controller (folder)
    • model (folder)
    • store (folder)
    • utils (folder)
    • view (folder)
    • Settings.js (file)
  • data (folder)
  • docs (folder)
  • ext-4 (folder)
  • resources (folder)
  • settigns (folder)
    • Settings.js (file)
  • app.js (file)
  • file.html (file)

This is my app.js code:

Ext.application({ name: 'MyApp' ,appFolder: 'app' ,requires: [ 'MyApp.Settings' ] ,stores:['strFichaCredenciales', 'strClientes'] ,controllers: [ 'ctrlMenuPrincipal' ,'ctrlArbolOrganigrama' ,'ctrlFichaCredenciales' ,'ctrlOfertasComerciales' ] ,autoCreateViewport: true ,init: function() { this.splashscreen = Ext.getBody().mask('CArgando aplicacion', 'splashscreen'); } ,launch: function() { Ext.getBody().unmask(); if (MyApp.Settings.dsplg) Ext.ComponentManager.get('viewDespliegue').show(); else Ext.ComponentManager.get('viewDespliegue').hide(); if (MyApp.Settings.in18) Ext.ComponentManager.get('ComboTraslation').show(); else Ext.ComponentManager.get('ComboTraslation').hide(); } }); 

This is my Settings.js code:

Ext.define('MyApp.Settings', { singleton: true, settingKey2: 'settingValue2', settinglocale: 'es', (here are more variables) } 

In app.js, in requires option I´m loading the Settings.js file that is in the app folder, but i don´t know how to load the one in settings folder intead of the one in app folder. Both Settings.js files are as the code above.

1 Answer 1

2

You can try around with Ext.Loader.setPath.

The easiest and standard-conforming way would be to define your settings as MyApp.settings.Settings and then use

Ext.Loader.setPath('MyApp.settings', 'settings'); Ext.require('MyApp.settings.Settings'); 

Alternatively, you can use Ext.Loader.loadScript and provide the path and file name.

Sign up to request clarification or add additional context in comments.

1 Comment

Ok,I will try both options.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.