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:
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;
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>