ColdFusion 9: New Attributes in CFGrid
Posted At : Oct 16, 2009 1:49 AM
Posted By : Akbarsait
Categories:
ColdFusion
,
ColdFusion 9
ColdFusion 9 introduces 4 new attributes in CFGrid tag. These attributes are great addition to CFGrid which allows us to expand or collapse the entire grid, we can group the rows in CFGrid by mentioning the group column name which generates a collapsible group of rows in the grid, we can insert a new row in the Grid and we can give a title to the entire CFGrid.
select title, genre
from books
</cfquery>
<cfform name="gridform">
<cfgrid
name="BooksGrid"
format="HTML"
query="qGetBooks"
title="CF 9 CFGrid Enhancements"
collapsible="true"
groupfield="genre"
selectmode="edit"
insert="true"
insertbutton="Insert Book"
width="250">
<cfgridcolumn name="title" header="Book Title" />
<cfgridcolumn name="genre" header="Genre" />
</cfgrid>
</cfform>
All these new attributes are available only for HTML type grids. In the above code I have defined the collapsible as true and assigned a value for the title attribute. The insert and insertbutton attributes will take effect only when the selectmode is true. On clicking the Insert Book button at the bottom of the grid will introduce a new row at the end and user can add a new record.
Here are the screen-shots of the above code output.



There are no comments for this entry.
[Add Comment]