• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

Grids

The cfgrid tag provides a Java-based grid control for displaying and editing tabular data. cfgrid allows you to display data sets in a familiar spreadsheet format that makes scrolling through and updating multiple records easy. A sample cfgrid control for displaying data can be seen in Figure 10-5. Example 10-11 queries a database and subsequently populates a cfgrid control with the record set data.

The cfgrid control
Figure 10-5. The cfgrid control
Example 10-11. Creating a basic grid control
<cfquery name="GetPeople" datasource="ProgrammingCF">
  SELECT * 
  FROM EmployeeDirectory
</cfquery>
   
<cfform action="#CGI.Script_Name#" name="MyForm" 
        enctype="application/x-www-form-urlencoded">
  <cfgrid name="MyGrid" width="600" height="250" autowidth="Yes" 
          query="GetPeople" selectmode="Browse"
          notsupported="<b>Your web browser must support Java to view 
                        ColdFusion Java Applets</b>">
  </cfgrid>
</cfform>

PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


  
  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint