Saturday, December 8, 2012
Ext JS 4–DOM Handling
ExtJS has core framework which helps in dom handling and event management.
The main class is Element class which is ExtJS wrapper around the dom nodes. There are ExtJS utilities to select and manipulate the Dom elements.
The Element class normalizes the DOM manipulation and provides positioning capabilities.
There are two way to get the Element
- Ext.get(id)
- Ext.fly(id).
Both method takes the id of element we are referring in the page. Lets see a example
In the example above, we are trying to get the value of three text box defined. We are using Ext.get(‘fname’) to get the Element wrapper for fname textbox. We can add animation to using element.highlight() or frame(). All Element object have animation method added to it as Mixins. Let see the enhanced code, On click of button lets highlight the textboxes.
ExtJS - Demos
This is a h2 header
Person Form
fnameEl.highlight("0000ff", {
duration : 2000
});
lnameEl.highlight("0000ff", {
duration : 2000
});
cityEl.highlight("0000ff", {
duration:2000
});
The demo can be found here
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment