Jarred Nicholls

.NET, RoR/Merb, iPhone, ExtJS, & more

Ext.tree.MultiSelectionModel Doesn't Unselect

clock August 19, 2008 09:38 by author jarred

The Ext.tree.MultiSelectionModel handles multiple selections very well by utilizing the well known Ctrl+Click action to do multiple selections of tree nodes.  However, doing Ctrl+Click on an already selected node does not unselect it, which is quite unintuitive to the Ctrl+Click action.  To add this behavior, simply override the private onNodeClick method of the MultiSelectionModel class:

Ext.override(Ext.tree.MultiSelectionModel, {
    onNodeClick: function(node, e){
        if (e.ctrlKey && this.isSelected(node))
            this.unselect(node);
        else
            this.select(node, e, e.ctrlKey);
    }
});

Currently rated 5.0 by 2 people

  • Currently 5/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5


ColumnTree - Headers Always Up Top

clock August 19, 2008 08:30 by author jarred

A popular user extension to ExtJS, Ext.tree.ColumnTree (originally just a demo), suffers from a few lacking features.  These features include:

  • Header isn't anchored at the top
  • Cannot resize column width
  • Cannot reorder columns
  • Cannot click headers for sortability

Because all of these features are found in the GridPanel, people have grown to love these features, and thus expect them in any column-based data layout.  There is a user extension named TreeGrid, rumored to be adopted as a part of the Ext widget library, that provides these features.  However, the extension is currently a little immature, and is more geared to being a Grid than it is to being a Tree (if that makes any sense?).  So in the meantime, while it's being matured, I extended the ColumnTree to at least have an anchored column header bar, and will perhaps add the other features in the near future.

Another small edition is that I have added the xtype registration of 'columntreepanel', so you can create the ColumnTree via an xtype config object, rather than its constructor.

ux-columnnodeui.js (4.46 kb)

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5


ExtJS iPhone Extensions

clock August 16, 2008 07:10 by author jarred

With the release of the iPhone and especially the iPhone 3G, the demand to create iPhone-compatible and iPhone-enriched web pages and applications has sky rocketed.

In my humble opinion, there is no better framework to create rich internet applications than the famous ExtJS.  Being an early contributor and active community member for ExtJS, I believe in it whole-heartedly.  While ExtJS does a lot of, if not all of, the heavy lifting for the average application and will create iPhone-compatible applications with ease, it has not been extended to create iPhone-enriched applications.

An iPhone-enriched application takes advantage of the Safari and iPhone specific additions to the DOM and Javascript API.  Such things as iPhone orientation events, SQLite integration, and native CSS selectors are a couple of the major iPhone specific features that ExtJS should extend itself to use or wrap with friendly code.

Stay tuned, as I have volunteered myself to Aaron and Jack from ExtJS to create this extension for the community.

Currently rated 5.0 by 1 people

  • Currently 5/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5


About the author

Jarred Nicholls

Architect

Scientist

Entrepreneur

RecentPosts

Month List

Sign in