Ext quick tip... Ext.get and element
Category Javascript SnTT
Bookmark :
By way of a belated show-n-tell Thursday..
If you haven't come across the Ext JavaScript framework its well worth a look. I have been using it recently and it certainly makes JavaScript development tons easier. Even the simple utility type classes and functions are useful. As such I thought I might pick some of these out
Ok, if your doing basic JavaScript manipulation of the HTML DOM then you usually want to do things like document.getElementById( '<element name>' ). This gets you an HTML DOM element and you can manipulate the element.
e.g. hide the element with:
document.getElementById( '<element name>' ).style.display='none';
This is all good but ext does this.
var el = Ext.get( '<element name>' );
Then with el you can do this ..
el.setVisible( false );
Not much different but easier to remember and another big advantage being that the Ext developers do a great job of making the code cross-browser compatible - so you don't have to.
The Ext API is an easy to use reference especially if you are familiar with typical object documentation that comes with most languages.
Bookmark :
By way of a belated show-n-tell Thursday..
If you haven't come across the Ext JavaScript framework its well worth a look. I have been using it recently and it certainly makes JavaScript development tons easier. Even the simple utility type classes and functions are useful. As such I thought I might pick some of these out
Ok, if your doing basic JavaScript manipulation of the HTML DOM then you usually want to do things like document.getElementById( '<element name>' ). This gets you an HTML DOM element and you can manipulate the element.
e.g. hide the element with:
document.getElementById( '<element name>' ).style.display='none';
This is all good but ext does this.
var el = Ext.get( '<element name>' );
Then with el you can do this ..
el.setVisible( false );
Not much different but easier to remember and another big advantage being that the Ext developers do a great job of making the code cross-browser compatible - so you don't have to.
The Ext API is an easy to use reference especially if you are familiar with typical object documentation that comes with most languages.
- 







Comments
Posted by null At 20:15:38 On 06/01/2008 | - Website - |