Home arrow JavaScript arrow Page 4 - Developing Information and Question Boxes with the Ext JS Library
JAVASCRIPT

Developing Information and Question Boxes with the Ext JS Library


Welcome to the fourth article in a five-part series on building message boxes with the Ext JS framework. In this part of the series, I demonstrate how to create a couple of message boxes for displaying quick information and different questions to users of a web site.

Author Info:
By: Alejandro Gervasio
Rating: 5 stars5 stars5 stars5 stars5 stars / 1
August 31, 2009
TABLE OF CONTENTS:
  1. · Developing Information and Question Boxes with the Ext JS Library
  2. · Building a dynamic wait bar with the Ext JS library
  3. · Building a simple info box with the Ext JS library
  4. · Constructing an appealing question box

print this article
SEARCH DEVARTICLES

TOOLS YOU CAN USE

advertisement
Developing Information and Question Boxes with the Ext JS Library - Constructing an appealing question box
(Page 4 of 4 )

As you might have guessed, in the content of the Ext JS framework, a question box is simply a message window that asks the user something, and nothing else. However, this simple process can be performed in a professional fashion by way of an elegant interface.

The following hands-on example illustrates how to build a question box in a few simple steps by using the “MessageBox” class included with this JavaScript library. Here’s the corresponding code sample:

<!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>

Definitely, the above example should be really easy for you to grasp, since it looks nearly identical to the one that I coded in the previous section to build an info window. Of course, the only difference to spot here is the utilization of a “question” icon, which is displayed within the pertinent box.

The following line of code shows how the mentioned “question” icon is included into the message window:

icon: Ext.MessageBox.QUESTION

Finally, in order to complement the prior explanation, I included an additional screen capture that shows quite clearly how this question box looks. Here’s the pertinent image:



And with this concluding example I’m finishing this fourth tutorial of the series. As always, feel free to utilize all of the code samples developed in it, so you can expand your existing skills in building cool information and question boxes with the Ext JS library.

Final thoughts

In this fourth chapter of the series, you hopefully extended your experience in using the Ext JS framework, since I demonstrated how to create a couple of message boxes for displaying quick information and different questions to users of a web site.

In the last article, I’ll finish discussing the construction of information boxes with the Ext JS library by showing you how to create some warning and error windows.

Now that you’re well aware of the topics that will be covered in the final tutorial of the series, you won’t want to miss it!


DISCLAIMER: The content provided in this article is not warranted or guaranteed by Developer Shed, Inc. The content provided is intended for entertainment and/or educational purposes in order to introduce to the reader key ideas, concepts, and/or product reviews. As such it is incumbent upon the reader to employ real-world tactics for security and implementation of best practices. We are not liable for any negative consequences that may result from implementing any information covered in our articles or tutorials. If this is a hardware review, it is not recommended to open and/or modify your hardware.

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