Welcome Guest, Not a member yet? Register   Sign In
use ExtJS for views (prob to include and load it)
#1

[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 Sad

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:
&lt; script type="text/javascript" src="/extjs/ext-all.js"&gt;< / script>

and this

Code:
&lt; script type="text/javascript" src="&lt;?=basepath;?&gt;/extjs/ext-all.js"&gt;< / script>

No way

got the page but I think that library doesn't load Sad

I got this errors in FIREBUG
Code:
Ext is not defined
[Break on this error] Ext.onReady(function(){
layout.js (line 9)
Ext is not defined
[Break on this error] Ext.DomHelper=function(){var L=null;var F=/^(?:br|frame|hr|img|input|link|meta|r...
ext-all.js (line 9)
sp is undefined
[Break on this error] Ext={version:"2.0.2"};window["undefined"]=window["undefined"];Ext.apply=function...
ext-base.js (line 9)
Ext.onReady is not a function
[Break on this error] Ext.onReady(Ext.example.init, Ext.example);
examples.js (line 60)

Please Help I'm lost

Regards
#2

[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">
&lt;html&gt;
&lt;head&gt;
&lt;meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"&gt;
&lt;title&gt;Example&lt;/title&gt;
&lt;link rel="stylesheet" type="text/css" href="/extjs/resources/css/ext-all.css"&gt;



&lt;link rel="stylesheet" type="text/css" href="/extjs/examples/examples.css"&gt;

    
    
    

    &lt;style type="text/css"&gt;
        .x-panel-body p {
            margin: 10px;
            font-size: 12px;
        }
    &lt;/style&gt;
&lt;/head&gt;
&lt;body&gt;

&lt;!-- EXAMPLES --&gt;
<h1>Windows with Layouts</h1>
<p>This example shows how Ext containers can be nested in windows to create advanced layouts.</p>
&lt;input type="button" id="show-btn" value="Show Window"/&gt;<br/><br/>
<p>Note that the js is not minified so it is readable. See <a href="/extjs/examples/window/layout.js">layout.js</a> for the full source code.</p>
<img src="/extjs/docs/resources/accordian.gif">
&lt;/body&gt;
&lt;/html&gt;


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 Sad
#3

[eluser]Michael Wales[/eluser]
Code:
&lt; script type="text/javascript" src="/extjs/ext-all.js"&gt;< / 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:
&lt; script type="text/javascript" src="&lt;?= base_url(); ?&gt;assets/js/ext-all.js"&gt;

This way it looks for the file in:
htdocs/[the_app]/assets/js/
#4

[eluser]Michael Wales[/eluser]
Quote:/
/index.php
/extjs/

Is that the file structure for your webroot? Or are you working from a sub-folder within your webroot?
#5

[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 ?!?
#6

[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...
#7

[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">
&lt;html&gt;
&lt;head&gt;
&lt;meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"&gt;
&lt;title&gt;Example&lt;/title&gt;
&lt;link rel="stylesheet" type="text/css" href="http://supervoisin/extjs/resources/css/ext-all.css"&gt;



&lt;link rel="stylesheet" type="text/css" href="http://supervoisin/extjs/examples/examples.css"&gt;

    

    
    

    &lt;style type="text/css"&gt;
        .x-panel-body p {
            margin: 10px;
            font-size: 12px;
        }
    &lt;/style&gt;
&lt;/head&gt;
&lt;body&gt;

&lt;!-- EXAMPLES --&gt;
<h1>Windows with Layouts</h1>

<p>This example shows how Ext containers can be nested in windows to create advanced layouts.</p>
&lt;input type="button" id="show-btn" value="Show Window"/&gt;<br/><br/>
<p>Note that the js is not minified so it is readable. See <a href="http://supervoisin/extjs/examples/window/layout.js">layout.js</a> for the full source code.</p>
<img src="/extjs/docs/resources/accordian.gif">
&lt;/body&gt;
&lt;/html&gt;

http://supervoisin/ is my local VirtualHost :d (normal without .com)

My question is why did the library not load !!!

I got the same errors Sad
#8

[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
#9

[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.
#10

[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 Sad I have anything)

I added the :


Code:
alert('ext Loaded');

in the top of the file after :
Code:
/*
* Ext JS Library 2.0.2
* Copyright(c) 2006-2008, Ext JS, LLC.
* [email protected]
*
* http://extjs.com/license
*/

and before :


Code:
Ext.DomHelper=function(){var L=null;var F=/^(?:br|frame|hr|img|input|link|meta|range|




Theme © iAndrew 2016 - Forum software by © MyBB