Archive for February, 2008

Simple Tasks v2 – Multiple lists, NativeWindows and Reminders

Sunday, February 24th, 2008

In collaboration with Adobe, one of the key additions in Ext 2.0.2 was Adobe AIR 1.0 support for running in the application sandbox. Also, the Simple Tasks AIR application sample was rewritten to take advantage of more of the native functionality in AIR and gained some cool custom Ext components that can be used outside of AIR.

AIR APIs

First, lets cover some of the AIR APIs that were used:

NativeWindow
This was one of the most useful additions to the Ext.air package. It provides an API to create windows, manage those windows, listen for events like standard Ext Observables and automatic state management for the windows.

var win = new Ext.air.NativeWindow({
    id: winId,
    file: 'task.html',
    width:500,
    height:350,
    resizable: true
});

Task NativeWindow in Simple Tasks 2

Ext.sql.*
The Ext.data.Store/Record and AIR Sqlite API got an upgrade from the asynchronous database access in the early AIR betas to the synchronous database access introduced in AIR beta 3.

Simple Tasks demonstrates the ease of integration of Ext with Sqlite, using automatic persistence Ext.data.Record instances (e.g. Tasks or Lists) in the database.

tx.data.ListStore = Ext.extend(Ext.data.Store, {
    constructor: function(){
        // superclass call
        tx.data.ListStore.superclass.constructor.call(this, {
            sortInfo:{field: 'listName', direction: "ASC"},
            reader: new Ext.data.JsonReader({
                id: 'listId',
                fields: tx.data.List
            })
        });
 
        this.conn = tx.data.conn;
        // Ext.sql.Proxy for managing Sqlite persistence
        this.proxy = new Ext.sql.Proxy(tx.data.conn, 'list', 'listId', this);
    },
    ...

Native Drag and Drop and Clipboard
Simple Tasks v2 supports dragging any text from any application into the grid to automatically create a new task. You can also paste text from the system clipboard as a new task. However, one of the coolest features is the ability to drag tasks straight from Outlook into Simple Tasks.

Dragging Outlook tasks into Simple Tasks

Minimize to System Tray
After the initial release of Simple Tasks, one of things most requested internally here as Ext JS (yes, we actually use it!) was the ability to minimize to the windows System Tray. We added support to automatically manage the System Tray functionality to the Ext.air.NativeWindow class, so now minimizing to the system tray is as simple as setting a config option.

var win = new Ext.air.NativeWindow({
    id: 'mainWindow',
    instance: window.nativeWindow,
 
    // System tray config
    minimizeToTray: true,
    trayIcon: 'ext-air/resources/icons/extlogo16.png',
    trayTip: 'Simple Tasks',
    trayMenu : [{
        text: 'Open Simple Tasks',
        handler: function(){
            win.activate();
        }
    }, '-', {
        text: 'Exit',
        handler: function(){
            air.NativeApplication.nativeApplication.exit();
        }
    }]
});

Simple Tasks in the System Tray

Sound
AIR also supports playing sounds. Ext.air.Sound makes that even easier.

Ext.air.Sound.play('beep.mp3');

The irritating beeping sound is sure to catch your attention

Ext Custom Components

As noted above, the Simple Tasks application also features some useful samples of custom components in Ext. Some of them were specifically designed to be reusable and may be included as standard Ext components or samples in a future release.

ListTree
This component is similar to a ComboBox or SelectBox except the list of the component is backed by an Ext TreePanel. It makes display and selection within a hierarchical list much more intuitive than a standard flattened list.

Another cool sample that goes along with this component is a custom selection model “ActivationModel”. As the name may suggest, it support 2 forms of selection – activation and selection. With activation, the component supports full keyboard navigation, expand/collapse with the keyboard and unlike the standard tree selection model, selection is an action on it’s own.

TreeList supports selection of data organized hierarchically

Custom Grid Columns
The easiest way to explain is with screenshots.

Pseudo button column, used to toggle complete/active

Menu column, used to set quick reminders

Switch Button
This component is like a radio button seen commonly in desktop applications. It was named “Switch” Button so it wasn’t confused with the radio buttons already found in standard HTML. It provides a collection of buttons, one of which can be “pressed” at a time.

Quick view change

Summary
From AIR specific functionality to Ext extras, there are quite a few real world samples present in the Simple Tasks v2 application. If you are using Ext, I would highly recommend taking a look at the source.

- The full source can be found in the Ext 2.0.2 distribution under air/samples/tasks.

- Adobe AIR 1.0 can be downloaded here.

- The Simple Tasks v2 AIR application can be downloaded here.

- You can read about the first version of Simple Tasks in the original blog post.

Coolite Studio: Ext Web Controls for ASP.Net

Monday, February 18th, 2008

With Microsoft’s .Net development platform increasing in both popularity and features, we’re receiving more inquiries than ever as to how clients can leverage the Ext framework within .Net web applications. While Ext, being a client-side framework, has always worked with ASP.Net applications, the team at Coolite has taken Ext & .Net integration a step further.

Introducing Coolite Studio

Coolite, the same team that brought you the very cool DateJS date parsing library, have really embraced the Ext framework creating a suite of ASP.Net controls name Coolite Studio that are based on Ext and integrate with Visual Studio 2008:

“The suite of web controls were built with a focus on bringing full Visual Studio Design-Time support to the Ext JavaScript Framework. A marriage of server-side and client-side frameworks.”

Tight Integration, Extensive Features, Support

The suite of controls will include the following:

  • Powerful integration of the Ext JavaScript Framework.
  • Full Design-Time support in Microsoft Visual Studio 2005 & 2008 and Visual Web Developer 2005 & 2008.
  • Drag-and-drop ease of use.
  • Current support for Window, Panel and a many Form Controls including DatePicker, Calendar and HtmlEditor.
  • New Controls being added weekly.
  • Dual Licensed (LGPL 3.0 and Coolite Commercial License).
  • Professional support options available shortly.

Coolite has setup a community forum to help get developers introduced to Coolite Studio and plans to expand their support options in the future.

Coolite Studio is immediately available for download and supports both .Net 2.0 and 3.5.

Community Talk – February 2008

Thursday, February 14th, 2008

I regularly hit technorati, DZone and Google looking for recent Ext JS related blog posts. There’s always quite a bit going on in the blogsphere and we are going to start sharing the interesting ones we find here on the Ext JS Blog. Here are some of the ones I have read recently.

Savvy Duck Blog
I was surprised to have just found this blog. Here’s a great quote from the author that made my day:

“My javascript started with Prototype 1.4 , then Dojo 0.4, JQuery, Prototype 1.5, Dojo 0.9, Prototype 1.6 and then settled on Ext 2.0. I kept cycling around because my application needed controls that the library either didn’t provide, and I had to write my own, or the library had the control and then I had to write enormous amounts of code to get simple stuff to work. Ext became a godsend because almost everything was straightforward and I could customize it without having to go really deep into the library’s code nor write a lot of code to get it to work. It took me a matter of weeks to wrap up my first project with Ext. I used it in a second project with a far more elaborate user interface and had it pretty much done in a couple of weeks too. I am still surprised.”.

There’s nothing I like to hear about more than a developer having success with Ext. It’s even better when that developer is willing to share their experiences and insight with others. His blog has quite a few Ext posts and they are all well written. Here are a few of them:

- Mixing Ext’s Grid with JQuery’s Flot

- Introduction to the Ext Grid Object

- Ext Event Handling

- Design Patterns, MVC and Ext 2.0

Brice Mason on AOL Developer Network
Brice has 2 multi-part series of blog posts that cover developing full applications. The latest is built using Ext JS 2.0 in Adobe AIR.

- Adobe AIR Xdrive Picture Syncing: Part 1

- Adobe AIR Xdrive Picture Syncing: Part 2

- Adobe AIR Xdrive Picture Syncing: Part 3

- Adobe AIR Xdrive Picture Syncing: Part 4

- Creating an AOL OpenBlog Reader: Part 1

- Creating an AOL OpenBlog Reader: Part 2

Dan Vega’s Blog
Dan’s blog has a wealth of knowledge about using Ext 2.0 with Cold Fusion. He also posted a nice step by step tutorial about using Ext Forms that isn’t CF specific.

Getting Started with Ext Forms

More Posts

How to use the Ext JS Treeview (Ext.tree) with Ruby on Rails
The title says it all.

One Service Several Stores
Ext Stores with ASP.Net web services.

All about Ext.Button
A nice beginner oriented guide to Ext.Button.

Learn ExtJS AJAX: Defining grid properties at run time
Loading and configuring Ext grids over Ajax, instead of in the javascript source.

Are you blogging about Ext?
If you have written a blog post about Ext, please let us know by sending an email to news@extjs.com and we’ll cover it in the next Community Talk post.

IDEs, plugins and tools for Ext JS 2.0

Friday, February 1st, 2008

The Ext 2.0 API is very extensive and remembering all of the functions, properties or configs available is virtually impossible. The API documentation is very thorough, but it would be nice if IDEs would provide code assist options in JavaScript as they do in other languages such as Java and C#. Luckily, there are some IDEs and plugins available that do just that — and also have direct support for Ext 2.0.

Aptana Studio
When it comes to IDEs for JavaScript development, Aptana is definitely hard to miss. I personally use it daily for Adobe AIR development. However, the version of Ext (1.1) bundled with Aptana for code assist is a little outdated.

Markus Schmidleitner has created an Ext 2.0 Aptana plugin that works very well. To install it:

  • Download and install Aptana Studio.
  • Open up your Aptana application directory (for me that is C:\Aptana) and copy the jar file into the plugins folder.
  • Restart Aptana.
  • Go to Window -> Preferences -> Aptana -> Editors -> JavaScript -> Code Assist and select Ext 2.0 (you may need to deselect Ext 1.1).

Aptana Studio with Ext 2.0 code assist

Spket Eclipse Plugin & IDE
The Spket IDE has by far the most superior code assist for Ext 2.0. It uses the Ext .jsb project file and embedded script doc to build code assist that includes options inherited from base classes and full documentation.

It doesn’t have much for editing other types of files though (e.g. CSS), so my preference is to install it as an Eclipse plugin in Aptana. To install the plugin in Aptana:

  • Download and install Aptana Studio (includes Eclipse).
  • Start Aptana and navigate the application menu to: Help → Software Updates → Find and Install… → Search for new features to install → New remote site…
  • Name: “Spket”, Url: “http://www.spket.com/update/
  • Restart Aptana
  • Watch this Spket IDE Tutorial to see how to easily add Ext code assist (you can point it at the latest /src/ext.jsb to keep code assist up to date with the latest Ext version). The steps are basically:
    • Window → Preferences → Spket → JavaScript Profiles → New
    • Enter “ExtJS” and click OK
    • Select “ExtJS” and click “Add Library”, then choose “ExtJS” from the dropdown
    • Select “ExtJS” and click “Add File”, then choose the “ext.jsb” file in your “./ext-2.x/source” directory
    • Set the new ExtJS profile as the default by selecting it an clicking the “Default” button on the right-hand side of the “JavaScript Profiles” dialog.
    • Restart Aptana
    • Create a new JS file and type: Ext. and you should get the Ext Code completion options.



Since you will have installed it as a plugin in Aptana, chances are Aptana will still be your default JS editor. So to try Spket, you need to right click on a file and select Open with -> Spket JavaScript Editor.

Spket in Aptana with full documentation and code assist

Komodo Edit
Komodo Edit has the strongest support for editing multiple types of files, including Perl, PHP, Python, Ruby and Tcl; plus support for browser-side code including JavaScript, CSS, HTML and XML. It’s also available on Windows, Mac OS X and Linux.

To install Komodo with Ext support:

  • Download and install Komodo Edit.
  • Download the API catalog.
  • Go to Edit -> Preferences -> Code Intelligence and select the “Add an API catalog” button below the “API Catalog” section.
  • Select the ExtJS API catalog CIX file you downloaded above.

Komodo with Ext JS code intelligence

Dreamweaver
For those using Dreamweaver, there are two plugins available SpketDW (Dreamweaver MX 2004 or higher) and SpketDWCS (Dreamweaver CS3). Both are made by the same team (Spket) as the Eclipse plugin above, so both are very accurate and thorough. One nice feature available in the Dreamweaver plugins is support for config option code assist.

Config option code assist

Members code assist

To download and install, please visit their site.

Other IDEs
There is support for other IDEs, such as IntelliJ and Visual Studio 2008 being actively worked on by the community.

Summary
When working with Ext 2.0, there are quite a few tools available to help boost your productivity. Be sure to check them out. If you know of any other tools we’ve missed, please post a comment and let us know!