Using <CFGRIDUPDATE>
To illustrate the use of <CFGRIDUPDATE>, I've added the parameter SELECTMODE="edit" to my grid of Elvis films. When users view the grid, they can now edit the text that appears in the cells, as shown in Figure 12.9.
Figure 12.9. Using <CFGRIDUPDATE> to let users update table data.
The code is shown in Listing 12.10. It's still pretty basic stuff.
Listing 12.10 elvis_grid_edit.cfm
1: <CFQUERY NAME="get_movies" DATASOURCE="elvis"> 2: SELECT * FROM movies 3: </CFQUERY> 4: 5: <CFFORM NAME="grid" ACTION="grid_action.cfm" METHOD="post"> 6: 7: <CFGRID NAME="movies" QUERY="get_movies" SELECTMODE="edit"> 8: </CFGRID> 9: 10: <P> 11: ... |
Get Sams Teach Yourself ColdFusion® in 21 Days now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.