-
25 Mar 2011 6:54 AM #1
how to use ext.loader.setpath to include a .htm file
how to use ext.loader.setpath to include a .htm file
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
-
25 Mar 2011 7:04 AM #2Sencha - Senior Forum Manager
- Join Date
- Mar 2007
- Location
- St. Louis, MO
- Posts
- 33,611
- Vote Rating
- 435
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 @SenchaMitch
Sencha Inc, Senior Forum Manager
________________
http://www.JSONPLint.com - Source to lint your JSONP!
Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
https://github.com/mitchellsimoens
Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/
Need more help with your app? Hire Sencha Services services@sencha.com
Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is almost in print!
When posting code, please use BBCode's CODE tags.
-
27 Mar 2011 11:41 PM #3
Thx for your reply but it seems that the override doesn't work, it doesn't go into the override function.
-
28 Mar 2011 12:38 AM #4
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..
Similar Threads
-
Why am I forced to include EVERY file? Seriously? How can I get around this for 3.x?
By sonryhater in forum Ext 3.x: Help & DiscussionReplies: 2Last Post: 27 Jan 2010, 8:57 AM -
include an other html- file
By Generic1 in forum Ext 3.x: Help & DiscussionReplies: 2Last Post: 28 Jul 2009, 6:43 AM -
include .php file to a panel
By cabster in forum Ext 2.x: Help & DiscussionReplies: 2Last Post: 18 Feb 2008, 9:54 AM -
Include two .js files into a js file
By Tina G in forum Ext 1.x: Help & DiscussionReplies: 3Last Post: 19 Sep 2007, 11:11 PM -
Include external js file
By Digital God in forum Ext 1.x: Help & DiscussionReplies: 3Last Post: 5 Jul 2007, 7:50 AM


Reply With Quote