PDA

View Full Version : Ext is not define



danilozacyac
14 Mar 2011, 9:34 AM
Hi I'm new in Ext, i'm justo looking for some easy examples to get in, the problem is when i try to run my little app, the only thing i get is a error message like this

"Ext is not define"

Hope you can help me. Thanks

bryall
14 Mar 2011, 9:54 AM
Try encasing your code in onReady...



Ext.onReady( function() {
alert( typeof Ext );
} );

danilozacyac
14 Mar 2011, 12:38 PM
I have done what you say, but my code still failing, here the code im trying

Ext.onReady(function () {

Ext.get('textup').on('click', function (e, t) {
//simple slide of this element
slideText('up', 'slider');
Ext.get(t.id).frame('cccccc', 1);
});

Ext.get('textdown').on('click', function (e, t) {
//simple slide of this element
slideText('down', 'slider');
Ext.get(t.id).frame('cccccc', 1);
});

Ext.get('texttoggle').on('click', function (e, t) {
//simple toggle of this element
slideText('toggle', 'slider');
Ext.get(t.id).frame('cccccc', 1);
});

//simple function to slide text up and down and optionally hide..
var slideText = function (direction, element) {

var slideMe = Ext.get(element);

switch (direction) {
//determine the direction of travel
case 'up':
//lets check to see if this is visible and if not
//then its already hidden.

if (slideMe.isVisible()) {
//if we get here then the element is visible
slideMe.slideOut('t', {
easing: 'easeOut',
duration: .5,
remove: false,
useDisplay: true
});
}
break;
case 'down':
//lets check to see if this is visible and if
//it is then we do nothing.

if (!slideMe.isVisible()) {
//if we get here then the element is visible
slideMe.slideIn('t', {
easing: 'easeOut',
duration: .5
});
}
break;
default:
//the default action is simply to toggle the element
slideMe.toggle();
break

}
//ends the slider function
}

});


I forgot to mention im trying it with asp.net

thanks for the reply

bryall
14 Mar 2011, 12:41 PM
Use firebug and console.log( Ext );

You may be missing an include or something.

Do you have a working demo you can share to help debug?

walldorff
14 Mar 2011, 2:10 PM
Usually it's an error in the path to the Ext files. Try this in the <HEAD> section:
<link rel="stylesheet" type="text/css" href="http://dev.sencha.com/deploy/dev/resources/css/ext-all.css" />
<script type="text/javascript" src="http://dev.sencha.com/deploy/dev/adapter/ext/ext-base.js"></script>
<script type="text/javascript" src="http://dev.sencha.com/deploy/dev/ext-all.js"></script>

If that works, then check the path to your own Ext files on your server.

A simple way to check if the paths are alright, is to run your code in the browser, right click and show the source code. Then click on the links to Ext files, as well as the links to your own js/css files. If you get a 404 then you got the bug by the tail :)

steffenk
14 Mar 2011, 2:39 PM
Have a look to the net tab of firebug if something is red and not loaded. If so, correct the path.