Home arrow JavaScript arrow Page 2 - Building Warning and Error Boxes with the Ext JS Library
JAVASCRIPT

Building Warning and Error Boxes with the Ext JS Library


Welcome to the final installment of a five-part series that explains how to build cool message windows with the Ext JS library. This series steps you through creating several interactive message boxes using the Ext JS JavaScript framework, which can speed up the development of rich Internet applications.

Author Info:
By: Alejandro Gervasio
Rating: 3 stars3 stars3 stars3 stars3 stars / 3
September 14, 2009
TABLE OF CONTENTS:
  1. · Building Warning and Error Boxes with the Ext JS Library
  2. · Building info and question boxes with the Ext JS library
  3. · Building a warning box with the Ext JS framework
  4. · Building an appealing error box

print this article
SEARCH DEVARTICLES

TOOLS YOU CAN USE

advertisement
Building Warning and Error Boxes with the Ext JS Library - Building info and question boxes with the Ext JS library
(Page 2 of 4 )

As I stated in the introduction, the Ext JS framework permits you to build four distinct types of informative windows that can be used in different situations. In the previous article, I discussed how to create a pair of information and question boxes by using the "MessageBox" JavaScript class included in the library. Now let's quickly recall how these boxes were constructed.

Below I included two code samples that build these message windows, accompanied by the corresponding screen helps. Here they are:

<!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 an info 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 the info box when sample button is clicked on

Ext.onReady(function(){

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

Ext.MessageBox.show({

title: 'Info Icon',

msg: 'This is an info box!',

buttons: Ext.MessageBox.OK,

animEl: 'samplebutton',

icon: Ext.MessageBox.INFO

});

});

});

</script>

</head>

<body>

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

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

</body>

</html>




<!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 a question 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 question box when sample button is clicked on

Ext.onReady(function(){

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

Ext.MessageBox.show({

title: 'Question Icon',

msg: 'This is a question box!',

buttons: Ext.MessageBox.OK,

animEl: 'samplebutton',

icon: Ext.MessageBox.QUESTION

});

});

});

</script>

</head>

<body>

<h1>Building a question box with Ext JavaScript library</h1>

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

</body>

</html>


Now that you've examined the hands-on examples listed above, I will assume that you know how to use the Ext JS framework to build a pair of appealing info and question boxes.

Am I correct about this? Good! Now it's time to learn how to create a warning window by using practically the same approach demonstrated with the previous examples.

To see how this brand new warning box will be constructed, please click on the link that appears below and read the following section.


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 4 - Follow our Sitemap
Popular Web Development Topics
All Web Development Tutorials