Home arrow JavaScript arrow Page 3 - Constructing Alert Boxes and Wait Bars with the Ext JS Library
JAVASCRIPT

Constructing Alert Boxes and Wait Bars with the Ext JS Library


Welcome to the third part of a five-part series on building message boxes with the Ext JS framework. In this installment of the series, I will walk you through creating an appealing alert box and a useful wait bar by utilizing a few intuitive JavaScript classes bundled with the library. You'll find the task to be easy to tackle.

Author Info:
By: Alejandro Gervasio
Rating: 3 stars3 stars3 stars3 stars3 stars / 2
August 24, 2009
TABLE OF CONTENTS:
  1. · Constructing Alert Boxes and Wait Bars with the Ext JS Library
  2. · Building a progress bar with the Ext JS JavaScript framework
  3. · Constructing a professional-looking alert box
  4. · Building a useful wait window with the Ext JS library

print this article
SEARCH DEVARTICLES

TOOLS YOU CAN USE

advertisement
Constructing Alert Boxes and Wait Bars with the Ext JS Library - Constructing a professional-looking alert box
(Page 3 of 4 )

If you thought that building prompt and confirm windows by using the Ext JS package was a fairly easy process, then you'll be amazed when I show you how simple is to create a cool alert box. I may be overreacting here, but actually constructing this kind of box is only a matter of using a brand new method, not surprisingly called "alert()," with the correct parameters. That's all.

Having said that, please take a look at the following code sample. It creates an alert window by using the aforementioned JavaScript method:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">

<head>

<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />

<title>Building alert box with Ext JavaScript library</title>

<link rel="stylesheet" type="text/css" href="ext-all.css" />

<link rel="stylesheet" type="text/css" href="xtheme-default.css" />

<script type="text/javascript" src="ext-base.js"></script>

<script type="text/javascript" src="ext-all.js"></script>

<!-- load common styles for the examples -->

<link rel="stylesheet" type="text/css" href="examples.css" />

<script type="text/javascript">

// display alert box when sample button is clicked on

Ext.onReady(function(){

Ext.get('samplebutton').on('click', function(){

Ext.MessageBox.alert('Status', 'Your file data was saved!');

});

});

</script>

</head>

<body>

<h1>Building alert box with Ext JavaScript library</h1>

<button id="samplebutton">Display alert box</button>

</body>

</html>


Definitely, the above example isn't rocket science, right? As you can see, the alert box is built simply by using the pertinent "alert()" method that I mentioned a few lines before, which permits you to specify certain additional input parameters, such as the messages that will be displayed within the box in question.

In addition, the following screen shot will give you a clearer idea of how this alert box looks: 



So far, so good, right? Assuming that you already grasped the logic behind building an alert box with the Ext JS library, it's time to continue exploring its numerous capabilities. Therefore, in the section to come, I'm going to teach you how to create a pretty useful wait bar in a few simple steps.

As you may have guessed, to learn the complete details on how this wait bar will be constructed using the Ext JS framework, you'll need to click on the link that appears below and keep reading.


blog comments powered by Disqus
JAVASCRIPT ARTICLES

- More Top jQuery Tutorials for Beginners
- More Top jQuery Plugins for Menus
- Top jQuery Tutorials for Beginners
- New UI Framework and SDK for JavaScript Rele...
- JavaScript OpenPGP Tool, Node.js 0.6.3 Avail...
- Yahoo Releases Cocktails Language and Develo...
- Customizing jQuery Slideshows: Dynamic Contr...
- Customizing jQuery Slideshows: the animate()...
- Customizing jQuery Slideshows: slideUp() and...
- Customizing jQuery Slideshows: hide() and sh...
- Web Workers: Performing Calculations in Para...
- More Top JavaScript Frameworks and Libraries
- More Dynamic jQuery Styling Techniques
- The Top JavaScript Libraries
- The Top JavaScript Frameworks

Dev Articles Forums 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Weekly Newsletter
 
Developer Updates  
Free Website Content 
Contact Us 
Site Map 
Privacy Policy 
Support 



© 2003-2012 by Developer Shed. All rights reserved. DS Cluster 2 - Follow our Sitemap
Popular Web Development Topics
All Web Development Tutorials