Hello,
Because I used a servelet to map all the js file to htm file so when I want use Ext.loader.setpath() and a require method after, it will include just the .js file but not the .htm file.
What can I do?
Thanks
Hello,
Because I used a servelet to map all the js file to htm file so when I want use Ext.loader.setpath() and a require method after, it will include just the .js file but not the .htm file.
What can I do?
Thanks
If you change this, all the ExtJS files that it tries to include will be changed.
Believe this should work but is untested:
Code:Ext.override(Ext.Loader, { getPath: function(className) { var path = '', paths = this.config.paths, prefix, deepestPrefix = ''; if (paths.hasOwnProperty(className)) { return paths[className]; } for (prefix in paths) { if (paths.hasOwnProperty(prefix) && prefix === className.substring(0, prefix.length)) { if (prefix.length > deepestPrefix.length) { deepestPrefix = prefix; } } } path += paths[deepestPrefix]; className = className.substring(deepestPrefix.length + 1); path = path + "/" + className.replace(/\./g, "/") + '.htm'; path = path.replace(/\/\.\//g, '/'); return path; } });
Mitchell Simoens @LikelyMitch
Modus Create, Senior Frontend Engineer
________________
Need any sort of Ext JS help? Modus Create is here to help!
Check out my GitHub:
https://github.com/mitchellsimoens
Thx for your reply but it seems that the override doesn't work, it doesn't go into the override function.
it looks like the override doesn't works... I think the code is good but it can't override the function, i don't know why..