Cool New cfGrid Tricks

ColdFusion 9

The html format of cfgrid has some cool new tricks in ColdFusion 9.  First the placement of a column can be moved by dragging it elsewhere in the grid.  In the example below the 'aDate' column is moved:

Second, when you hover over a column and click on the menu drop down the following options appear which allow for sorting or removing a column (that can then be added back).

You may notice in this example that the sort options are greyed out.  This is because, for some reason, sort is disabled by default on Boolean type columns.  CF Mitrah found a simple solution for enabling sort posted in the comments of an entry on the four new data types.

I've rarely used cfgrid over the years but in ColdFusion 9 it starts to feel like its ready for the big leagues in part thanks to the new data types, the addition of grouping and inserting (see Akbarsait's blog entry for more) and being based on the impressive Ext JS 3.0 release.

Exploring ColdFusion 9: The Four New Data Types in CFGrid

ColdFusion 9

ColdFusion 9 brings four new data types to the html cfgrid.  As the docs state:

ColdFusion 9: Added boolean, date, numeric, and string_noCase to the
type attribute values supported in HTML grids

 

Lets take a look at these new types.  Here's a sample query from the art table that I added a date to and called it, well, aDate:

Query Dump

I'll display these using the following cfgridcolumn tags:

<cfgridcolumn name="artname" type="string_noCase">
<cfgridcolumn name="isSold" type="boolean">
<cfgridcolumn name="price" type="numeric">
<cfgridcolumn name="aDate" type="date">

Whats cool is that ColdFusion or ExtJS (I'm not sure which) is going to automatically try and convert these types from the data where possible.  The grid looks like this:

A quick run through of the various types;

  • string_noCase specifies that the column will be sorted without regards to case. 
  • The boolean type will show a checkbox, checked if the boolean is true.  From this example you can see that it is smart enough to convert 0 and 1's into Boolean as well as true and false. 
  • The price column is set to numeric which limits the editing of the column to just numbers. 
  • Leaving the best for last is the date type which when editing displays a nice calendar option.

Overall some pretty cool additions that make the cfgrid tag more useful.

Here's the full code to generate the above:

<cfquery name="getArt" datasource="cfartgallery">
select ARTID, ARTNAME, DESCRIPTION, ISSOLD, PRICE, CURRENT_DATE aDate 
from ART 
</cfquery>
<cfdump var="#getArt#" top="10">

<cfform>
<cfgrid format="html" name="art" query="getArt" align="left" selectmode="edit">
	<cfgridcolumn name="artname" type="string_noCase">
	<cfgridcolumn name="isSold" type="boolean">
	<cfgridcolumn name="price" type="numeric">
	<cfgridcolumn name="aDate" type="date">
</cfgrid>
</cfform>

Moving Jobs

Me, Interfolio

Today is my last day at Interfolio and ends an overall very happy chapter in my career.  I have become a better programmer, learnt an awlful lot and had many great experiences.  I leave behind a very talented technical team (Dominic O'Connor, Jon Dowdle and Rachel Lehman) who I'm confident will continue to turn out cool new product enhancements.

I am moving on to become a consultant at WebFirst working at the Federal Labor Relations Authority.  Its an exciting opportunity working with ColdFusion 9 and Flex.  The former I can't wait to really sink my teeth into while the later I've been wanting to learn for years so am looking forward to getting the chance. 

ColdFusion One Liners Presentation at CFinNC Slides Posted

ColdFusion 8, ColdFusion 9, CFinNC

The slides and code from my ColdFusion One Liners presentation at CFinNC are now up on SlideSix.

View the presentation on SlideSix

I enjoyed giving the presentation and if you have any questions let me know.

Adobe Listens: Feedback Shows up in ColdFusion 9

ColdFusion Builder, ColdFusion 9

Around two years, just after the successful launch of ColdFusion 8, I emailed some of the top dogs on the Adobe ColdFusion team about features for ColdFusion 9.  These where my suggestions and whether they made CF9:

  • An IDE.  ColdFusion Builder is here and one I've been happily using exclusively since its release. 
  • Shorter Syntax/Full cfscript Support.  The shorter syntax was an idea of mine to merge scripting in a tagging syntax. Looking back I'm not sure exactly how it would have worked but I am happy to see much improved support for cfscript.  Writing a cfc in script syntax feels good and should help those picking up ColdFusion.
  • cfspreadsheet.  Adobe nailed this one with the new tag and numerous Spreadsheet* functions.
  • cfaudio/cfvideo.  My request was for recording and editing Flash movies and possibly other formats. A little disapointed although these features are availible with other tools in the Adobe arsenal.  cfmediaplayer is a useful addition to ease the playing of Flash movies.
  • Built in ORM support.  The hibernate integration appears to be awesome so far.
  • Stronger support for {} and []: Happy to see more uses for these useful short cuts.
  • Optomize PDFs: Actually asked for this one later on but am delighted to see its inclusion.

The ColdFusion team did not listen just to me of course, from conversations I've had with them they listen to just about every blog post, review all ERs sent in and go out and talk to customers about their vision.  I've participated in the latter and they are very good sessions.

Overall I'm excited with the new features in ColdFusion 9 and pleased that my feedback was listened to (and mostly showed up in the final release) but I'm actually more excited about the features I did not suggest such as:

  • Advanced Caching
  • SharePoint Integration
  • Office Integration (including document to pdf conversion)
  • Java Portal Integration
  • Enhancements to Components
  • Integration with the Solr search engine
  • Faster Flash Remoting
  • ColdFusion as a Service

Congratulations to the whole ColdFusion team and all of those who have worked on the release of 9!

Speaking at CF in NC...Come Along and Enter to Win a Flip CF Dude Camera

ColdFusion, CFinNC

I am delighted to have been chosen to present at the CF in NC conference in October on the topic of "One Liners in ColdFusion".  Its a topic I enjoy, one that I've blogged about and one that Joe Rinehart mentioned in his excellent keynote on day two of CFUnited.

The session line up at CF in NC conference is very exciting and if you can make it I suggest coming along.  There is even a chance to win a CF Dude Flip Video Camera.


Search

Twitter
You should follow me on Twitter here
About Me
I am a 34-year old Web Developer specializing in ColdFusion. I live and work in downtown Washington, DC with my wife and two daughters. Read more About Me

2007 CFeMmy Best Newcommer winner
As voted on by fellow CF Bloggers.
CFinNC - Carolina ColdFusion / Flex / Air Conference - Oct 17-18, 2009