PDA

View Full Version : dynamic load class



mickarea
27 Oct 2016, 12:00 AM
Hi,

When I use the preview mode, the class load dynamically.

I would like to keep that behaviour, in production mode.


Why? Because I have a tree menu, and each time I click on the button menu, I would like to load a new page in the container "center" on my page. I don't want to refresh all the pages, how can I do that ?

Micka,

mickarea
27 Oct 2016, 12:09 AM
what about :


var classe = record.get('class');
if (ChunkCompile.isBuilt) {
// synchronously load JS
Ext.Loader.loadScriptFile(
classe+'.js',
function() {
console.log('SUCCESS');
},
function() {
console.log('FAIL');
},
this,
true
);
}
var center = Ext.getCmp('center');
center.removeAll(true);
center.add({ xtype: classe });

mickarea
27 Oct 2016, 12:25 AM
well, looks like that it's more complicated from this post :

https://www.sencha.com/blog/blazingly-fast-load-times-for-apps-built-with-ext-js-and-sencha-touch/

does someone know if extjs 6 make it more easier ? or architect ?