PDA

View Full Version : Append a custom attribute to js, css files when doing "requires"



prashantjain68
14 May 2015, 11:28 AM
Hi,
This is what we are trying to achieve with our ui application.

I want the loader to append the version number of the application to the js files when doing dynamic loading (or requires).

My request would look like ...
http:/......./a/b/c/d.js?version=1.0.1234

How would I do this using some sort of configuration. If not possible with configuration, then overrides etc is ok too.

Thanks
Prashant Jain

f.baron
15 May 2015, 12:20 AM
I didn't found any configuration to achieve this, anyway you should work on "loadScript" method of Ext.Loader, specially on rows:


src = config.disableCaching ?
(url + '?' + config.disableCachingParam + '=' + Ext.Date.now()) : url;


For example, to disable cache through different versions:


Ext.Loader.config.disableCaching = true;
Ext.Loader.config.disableCachingParam = 'version';

...

src = config.disableCaching ?
(url + '?' + config.disableCachingParam + '=' + App.version) : url;