« Teamstudio Ed24 | Main| Ext quick tip .. Ext.query »

Ext quick tip... Ext.get and element

Category  
Bookmark : del.icio.us  Technorati  Digg This  Add To Furl  Add To YahooMyWeb  Add To Reddit  Add To NewsVine 


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

Gravatar Image1 - Emoticon Emoticon Emoticon Emoticon Emoticon Emoticon Emoticon Emoticon Emoticon Emoticon Emoticon

Post A Comment

:-D:-o:-p:-x:-(:-):-\:angry::cool::cry::emb::grin::huh::laugh::lips::rolleyes:;-)

Welcome ..

View Scott Cochrane's profile on LinkedIn

My IdeaJams

tag cloud

MiscLinks

Googles

  • No Search Referers

OpenNTF

Poweredby

Domino BlogSphere
Version 3.0.1 Beta 9