Recent Weblogs

Links I like

DateChooser, decoupled objects make for an easy interface.

Built with prototype and a new style of event architecture allows for an all around easier grid API. Continued with an incredibly easy to use implementation of a date chooser.

Locale Time



Superclasses and Details

This demonstration is built using a small package of javascript classes that use the prototypejs library.

  • GridBase an abstract javascript class that introduces a comprehensive grid event API. Ideal for subclasses to take advantage for click and drag or mouse over cell events.
  • GridBuild further extends the GridBase class to introduce more methods for handling dynamic grid construction as well as easy data injection.
  • GregorianCalendar a subclass of prototype's ObjectRange class. Defines a range of dates to represent a month.
  • CalendarSelect extends GridBuild, using an instance of GregorianCalendar formats the data into a grid.
  • DateSelect extends CalendarSelect, enhances the interface to include convienence controls.
  • View Pure Demo Inspired by a comment on a previous post I have created a page that is an HTML document with only what is necessary for implementing the date chooser widget.

Addressing Comments

Some very helpful comments on this article which is pleasing to see. To address Jon and Alex's concerns I have developed a new subclass of CalendarSelect that uses two select boxes to engage the user, view the Demo.

To address Artemis's concerns I would suggest subclassing DateSelect and override the applyCellJSON function which is where you could implement special logic to assign more attributes to the cell for easier retrieval. Note that if you're looking to do something with a cell when it is clicked you can use the "cellclick" event, which is defined in GridBase .


Warning: mysql_connect() [function.mysql-connect]: Access denied for user 'mfoster'@'' (using password: YES) in /home/content/m/a/t/mattfoster01/html/includes/php_common/lib/classes/abstract.mySQL.php on line 15

Fatal error: Uncaught exception 'Exception' with message 'Failed to connect to mySQL server in method : mySQLBase::connect' in /home/content/m/a/t/mattfoster01/html/includes/php_common/lib/classes/abstract.mySQL.php:16 Stack trace: #0 /home/content/m/a/t/mattfoster01/html/includes/template/comment.php(29): mySQLBase->connect('', 'mfoster', 'havef8th') #1 /home/content/m/a/t/mattfoster01/html/blog/2007/09/javascript-date-chooser.php(128): include_once('/home/content/m...') #2 {main} thrown in /home/content/m/a/t/mattfoster01/html/includes/php_common/lib/classes/abstract.mySQL.php on line 16