use ExtJS for views (prob to include and load it) |
[eluser]bayrem[/eluser]
Hi, First of all I ant to thank you for this exellent and complete framework. I decide to use CI in my new project as the framework for views extjs (A well knwon JS library). I got prob including this one in one CI view ![]() I saw manuy posts and execionnaly this one who got prob like mine http://ellislab.com/forums/viewthread/73741/ the Prob : I can't include ExtJS library. Test : Code: < script type="text/javascript" src="/extjs/ext-all.js">< / script> and this Code: < script type="text/javascript" src="<?=basepath;?>/extjs/ext-all.js">< / script> No way got the page but I think that library doesn't load ![]() I got this errors in FIREBUG Code: Ext is not defined Please Help I'm lost Regards
[eluser]bayrem[/eluser]
I only gave an example in the main post, if u want the complete file here we are : Here is the the complete code used in the view file : Code: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> Info : I load an Image Code: <img src="/extjs/docs/resources/accordian.gif"> and the image displays without any prob PS : My folder structure is like this : / /index.php /extjs/ .... /view/ewemple.php ..... Au secours ![]()
[eluser]Michael Wales[/eluser]
Code: < script type="text/javascript" src="/extjs/ext-all.js">< / script> This is a relative link from your webroot: domain.com/extjs/ext-all.js Personally, since I work on multiple apps at a time, I have directories underneath my webroot for each project. Like so: htdocs - blog - classifieds - client_1 - system (this is the CI framework) So, when I reference CSS, JS, or images I use: Code: < script type="text/javascript" src="<?= base_url(); ?>assets/js/ext-all.js"> This way it looks for the file in: htdocs/[the_app]/assets/js/
[eluser]Michael Wales[/eluser]
Quote:/ Is that the file structure for your webroot? Or are you working from a sub-folder within your webroot?
[eluser]bayrem[/eluser]
here is my exact structure : |index.php |extjs |license.txt |public |system |----application => Here I put all my programmes (in controllers, views...) |-----------config |-----------controllers |-----------errors |-----------helpers |-----------hooks |-----------index.html |-----------language |-----------libraries |-----------models |-----------views |----cache |----codeigniter |----database |----fonts |----helpers |----language |----libraries |----logs |----plugins |----ressources |----scaffolding |tmp |user_guide I use the classic CI structure I think. Don't know if I made mistake ?!?
[eluser]Michael Wales[/eluser]
Try using the base_url() method I described above, then View -> Source and see if the target is what you were expecting...
[eluser]bayrem[/eluser]
The target is good, that is ok from the start. When copy paste the link in hte browser I got file content without any prob. exemple to load the view I got something like this : http://supervoisin/index.php/login.html login.html = view (html normal I changed the extension) the source on the rendred html : Code: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> http://supervoisin/ is my local VirtualHost :d (normal without .com) My question is why did the library not load !!! I got the same errors ![]()
[eluser]bayrem[/eluser]
I got a live demo I can let u see if u want just tell me and I will PM u the link thx
[eluser]Michael Wales[/eluser]
and the file exists at: /extjs/resources/css/ext-all.css ? Odd... at the very top of ext-all.js place: Code: alert('ext Loaded'); If you get an alert on refreshing (ctrl+f5) the file is loading and your copy of the lib is messed up.
[eluser]bayrem[/eluser]
1st this file is in up there : Code: http://supervoisin/extjs/resources/css/ext-all.css 2nd: the alert does not load ![]() I added the : Code: alert('ext Loaded'); in the top of the file after : Code: /* and before : Code: Ext.DomHelper=function(){var L=null;var F=/^(?:br|frame|hr|img|input|link|meta|range| |
Welcome Guest, Not a member yet? Register Sign In |