| Contents > CFML Reference > ColdFusion Tags > cfgrid > Using the href attribute |
|
|
|
|
||
When specifying a URL with grid items using the href attribute, the selectMode attribute value determines whether the appended key value is limited to one grid item or extends to a grid column or row. When a user clicks a linked grid item, a cfgridkey variable is appended to the URL, in this form:
http://myserver.com?cfgridkey = selection
If the appendKey attribute is set to No, no grid values are appended to the URL.
The value of selection is determined by the value of the selectMode attribute:
selectMode = "Single", selection is the value of the column clicked.selectMode = "Row", selection is a delimited list of column values in the clicked row, beginning with the value of the first cell in the row.selectMode = "Column", selection is a delimited list of row values in the clicked column, beginning with the value of the first cell in the column.Clicking the submit button while editing a grid cell occasionally causes the cell changes to be lost. To ensure that changes are submitted properly, Macromedia recommends that after user updates data in a cell, they click another cell before submitting the form.
<!--- This shows cfgrid, cfgridcolumn, cfgridrow, and cfgridupdate ---> <!--- use a query to show the useful qualities of cfgrid ---> <!--- If the gridEntered form field has been tripped, perform gridupdate
on table specified in database. Using default value keyonly = yes
lets us change only information that differs from previous grid ---> <cfif IsDefined("form.gridEntered") is True> <cfgridupdate grid = "FirstGrid" dataSource = "cfsnippets" tableName = "CourseList" keyOnly = "Yes"> </cfif> <!--- query the database to fill up the grid ---> <cfquery name = "GetCourses" dataSource = "cfsnippets"> SELECT Course_ID, Dept_ID, CorNumber, CorName, CorLevel, CorDesc FROM CourseList ORDER by Dept_ID ASC, CorNumber ASC </cfquery> <html> <head> <title>cfgrid Example</title> </head> <body> <h3>cfgrid Example</h3> <I>Try adding a course to the database, and then deleting it.</i> <!--- call thecfformto allow us to use cfgrid controls ---> <cfform action = "cfgrid.cfm"> <!--- We include Course_ID in cfgrid, but do not allow selection or display ---> <!--- cfgridcolumn tags are used to change the parameters involved in
displaying each data field in the table---> <cfgrid name = "FirstGrid" width = "450" query = "GetCourses" insert = "Yes" delete = "Yes" sort = "Yes" font = "Tahoma" bold = "No" italic = "No" appendKey = "No" highlightHref = "No" gridDataAlign = "LEFT" gridLines = "Yes" rowHeaders = "Yes" rowHeaderAlign = "LEFT" rowHeaderItalic = "No" rowHeaderBold = "No" colHeaders = "Yes" colHeaderAlign = "LEFT" colHeaderItalic = "No" colHeaderBold = "No" selectColor = "Red" selectMode = "EDIT" pictureBar = "No" insertButton = "To insert" deleteButton = "To delete" sortAscendingButton = "Sort ASC" sortDescendingButton = "Sort DESC"> <cfgridcolumn name = "Course_ID" dataAlign = "LEFT" bold = "No" italic = "No" select = "No" display = "No" headerBold = "No" headerItalic = "No"> <cfgridcolumn name = "Dept_ID" header = "Department" headerAlign = "LEFT" dataAlign = "LEFT" bold = "Yes" italic = "No" select = "Yes" display = "Yes" headerBold = "No" headerItalic = "Yes"> <cfgridcolumn name = "CorNumber" header = "Course ##" headerAlign = "LEFT" dataAlign = "LEFT" bold = "No" italic = "No" select = "Yes" display = "Yes" headerBold = "No" headerItalic = "No"> <cfgridcolumn name = "CorName" header = "Name" headerAlign = "LEFT" dataAlign = "LEFT" font = "Times" bold = "No" italic = "No" select = "Yes" display = "Yes" headerBold = "No" headerItalic = "No"> <cfgridcolumn name = "CorLevel" header = "Level" headerAlign = "LEFT" dataAlign = "LEFT" bold = "No" italic = "No" select = "Yes" display = "Yes" headerBold = "No" headerItalic = "No"> <cfgridcolumn name = "CorDesc" header = "Description" headerAlign = "LEFT" dataAlign = "LEFT" bold = "No" italic = "No" select = "Yes" display = "Yes" headerBold = "No" headerItalic = "No"> </cfgrid> </cfform> </body> </html> ...
|
|
||
| Contents > CFML Reference > ColdFusion Tags > cfgrid > Using the href attribute |
|
|
ColdFusion 8 | ColdFusion MX 7 | ColdFusion MX 6.1 | ColdFusion MX | Forums | Developer Center | Bug Reporting
Version 6.1
Comments are no longer accepted for ColdFusion MX 6.1. ColdFusion 8 is the current version.
RSS feed | Send me an e-mail when comments are added to this page | Comment Report
Current page: http://livedocs.adobe.com/coldfusion/6.1/htmldocs/tags-p50.htm
Comments
UKJools said on May 20, 2005 at 4:37 AM : Mike Carper said on Jun 17, 2005 at 8:54 AM :