JavaScript
  Home arrow JavaScript arrow Using the EXT JS Date Picker Widget
Dev Articles Forums 
ADO.NET  
Apache  
ASP  
ASP.NET  
C#  
C++  
ColdFusion  
COM/COM+  
Delphi-Kylix  
Design Usability  
Development Cycles  
DHTML  
Embedded Tools  
Flash  
Graphic Design  
HTML  
IIS  
Interviews  
Java  
JavaScript  
MySQL  
Oracle  
Photoshop  
PHP  
Reviews  
Ruby-on-Rails  
SQL  
SQL Server  
Style Sheets  
VB.Net  
Visual Basic  
Web Authoring  
Web Services  
Web Standards  
XML  
Mobile Linux 
App Generation ROI 
IBM® developerWorks 
Weekly Newsletter
 
Developer Updates  
Free Website Content 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us Get Paid 
Request Media Kit
Contact Us 
Site Map 
Privacy Policy 
Support 
 USERNAME
 
 PASSWORD
 
 
  >>> SIGN UP!  
  Lost Password? 
JAVASCRIPT

Using the EXT JS Date Picker Widget
By: Dan Wellman
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 4 stars4 stars4 stars4 stars4 stars / 5
    2008-07-14

    Table of Contents:
  • Using the EXT JS Date Picker Widget
  • Invoking the Date Picker
  • Finishing the Example
  • Finishing continued

  • Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      Del.ici.ous Digg
      Blink Simpy
      Google Spurl
      Y! MyWeb Furl
    Email Me Similar Content When Posted
    Add Developer Shed Article Feed To Your Site
    Email Article To Friend
    Print Version Of Article
    PDF Version Of Article
     
     
    ADVERTISEMENT


    Using the EXT JS Date Picker Widget


    (Page 1 of 4 )

    In a recent article I looked at the EXT JS JavaScript library and gave a brief overview of what it does and what it contains. In this article we’re going to look at implementing one of the many widgets that come with the library – the date picker widget.

    Getting Started

    You’ll need a copy of the library of course; to get it you can go to the EXT JS site at http://extjs.com and visit the downloads page. Once downloaded, create a directory in which to store the library and the example page that we’ll be creating; c:extjs-site should suffice. Next create another new directory within this called ext and unpack the library to this folder. Now that the library is installed we can begin coding. In a new file in your text editor, create the following basic page:

    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">

    <html>

    <head>

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

    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">

    <title>EXT JS Datepicker Example</title>

    </head>

    <body>

    <label>Enter a date: </label><input type="text" id="dateField"><button id="openCalendar">Open Calendar</button><div id="calendar"></div>

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

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

    </body>

    </html>


    Aside from the standard page furniture common to any basic web page (doctype declaration, content type declaration, etc), we have three files from the library. The first is the CSS file responsible for styling the widgets in EXT JS; next is the base file for the library (ext-base.js) which sets up the namespacing, the internal cache and provides other core services; finally, there is a file that encompasses all of utilities and widgets within the library. Using this file means that we don’t need to worry about which other components the DatePicker class needs in order to function correctly.

    The body of the page contains a simple text box, which is where the date that is chosen using the date picker will be placed; a button that will be used to open the date picker (we could use the button widget from the library, but we’ll stick with the standard HTML equivalent for this example); and an empty container element for the date picker to be rendered into.

    More JavaScript Articles
    More By Dan Wellman


       · I hope this article shows you how powerful Ext-js is and how easy it is to...
       · Dan.. great example. Since many pages have multiple dates/calendars, perhaps you can...
       · found this clean solution at: http://extjs.com/forum/showthread.php?t=20776
     

    JAVASCRIPT ARTICLES

    - Validating Digits and Dates with jQuery`s Va...
    - Validating Ranges, Emails, and URLs with jQu...
    - More Uses for the jQuery Tooltip Plug-in`s b...
    - Building Image-Based Tooltips with the jQuer...
    - Using the jQuery Tooltip Plug-in`s bodyHandl...
    - Using Rangelength, Min and Max with the Vali...
    - Using Minlength and Maxlength with the Valid...
    - Modifying Tooltip Coordinates with the jQuer...
    - Applying a Fade Out Effect with the jQuery T...
    - Tracking Mouse Movements with the jQuery Too...
    - Checking Online Forms with the Validator jQu...
    - Nested JavaScript Functions as Objects
    - The jQuery Tooltip Plug-in
    - Active Client Pages at the Server
    - ACP Tab Web Page







    © 2003-2009 by Developer Shed. All rights reserved. DS Cluster 2 Hosted by Hostway
    Stay green...Green IT