CFGRID TO PDF

Developing ColdFusion MX Applications with CFML Building Dynamic Forms Creating data grids with cfgrid The cfgrid tag creates a cfform grid control that resembles a spreadsheet table and can contain data populated from a cfquery or from other sources of data. As with other cfform tags, cfgrid offers a wide range of data formatting options as well as the option of validating user selections with a JavaScript validation script. You can also do the following tasks with cfgrid: Sort data in the grid alphanumerically Update, insert, and delete data Display images in the grid Users can sort the grid entries in ascending order by double-clicking any column header. Double-clicking again sorts the grid in descending order. You can also add sort buttons to the grid control. When users select grid data and submit the form, ColdFusion passes the selection information as form variables to the application page specified in the cfform action attribute.

Author:Vudokree Grorisar
Country:Dominican Republic
Language:English (Spanish)
Genre:Career
Published (Last):18 March 2013
Pages:117
PDF File Size:6.23 Mb
ePub File Size:6.83 Mb
ISBN:303-5-76159-597-7
Downloads:89397
Price:Free* [*Free Regsitration Required]
Uploader:Kasar



Developing ColdFusion MX Applications with CFML Building Dynamic Forms Creating data grids with cfgrid The cfgrid tag creates a cfform grid control that resembles a spreadsheet table and can contain data populated from a cfquery or from other sources of data. As with other cfform tags, cfgrid offers a wide range of data formatting options as well as the option of validating user selections with a JavaScript validation script.

You can also do the following tasks with cfgrid: Sort data in the grid alphanumerically Update, insert, and delete data Display images in the grid Users can sort the grid entries in ascending order by double-clicking any column header. Double-clicking again sorts the grid in descending order. You can also add sort buttons to the grid control.

When users select grid data and submit the form, ColdFusion passes the selection information as form variables to the application page specified in the cfform action attribute. Just as the cftree tag uses cftreeitem, cfgrid uses the cfgridcolumn and cfgridrow tags.

You can define a wide range of row and column formatting options, as well as a column name, data type, selection options, and so on. You use the cfgridcolumn tag to define individual columns in the grid or associate a query column with a grid column.

Use the cfgridrow tag to define a grid that does not use a query as the source for row data. If a query attribute is specified in cfgrid, the cfgridrow tags are ignored. The cfgrid tag provides many attributes that control grid behavior and appearance.

This chapter describes only the most important of these attributes. Working with a data grid and entering data The following figure shows an example grid created using the cfgrid tag: The following table describes some navigating tips: Action Procedure Sorting grid rows Double-click the column header to sort a column in ascending order.

Double-click again to sort the rows in descending order. Rearranging columns Click any column heading and drag the column to a new position. Determining editable grid areas When you click an editable cell, it is surrounded by a yellow box. Determining noneditable grid areas When you click a cell or row or column that you cannot edit, its background color changes.

The default color is salmon pink. Editing a grid cell Double-click the cell. You must press Return when you finish entering the data. Deleting a row Click any cell in the row and click the Delete button.

Inserting a row Click the Insert button. An empty row appears at the bottom of the grid. To enter a value in each cell, double-click the cell, enter the value, and click Return.

To populate a grid from a query: Create a new ColdFusion page named grid1. Save the file and view it in your browser. If you specify a cfgrid tag with a query attribute defined and no corresponding cfgridcolumn attributes, the grid contains all the columns in the query.

Other modes are row, column, and edit. Creating an editable grid You can build grids to allow users to edit data within them. Users can edit individual cell data, as well as insert, update, or delete rows. To let users add or delete grid rows, you also have to set the insert or delete attributes in cfgrid to Yes.

Setting insert or delete to Yes causes the cfgrid tag to display insert and delete buttons as part of the grid, as the following figure shows: You can use a grid in two ways to make changes to your ColdFusion data sources: Create a page to which you pass the cfgrid form variables. In that page perform cfquery operations to update data source records base on the form values returned by cfgrid.

Pass grid edits to a page that includes the cfgridupdate tag, which automatically extracts the form variable values and passes that data directly to the data source. Using cfquery gives you complete control over interactions with your data source. The cfgridupdate tag provides a much simpler interface for operations that do not require the same level of control. Controlling cell contents The value, valuesDisplay, and valuesDelimiter attributes of the cfgridcolumn tag let you control the data that a user can enter into a cfgrid cell in the following ways: By default, a cell is not editable.

Use the type attribute to control sorting order, to make the fields check boxes, or to display an image. Use the values attribute to specify a drop-down list of values from which the user can chose. You can use the valuesDisplay attribute to provide a list of items to display that differs from the actual values that you enter in the database. You can use the valuesDelimiter attribute to specify the separator between values in the values valuesDisplay lists. While cfgrid does not have a validate attribute, it does have an onvalidate attribute that lets you specify a JavaScript function to perform validation.

For more information on controlling the cell contents, see the attribute descriptions in CFML Reference. How user edits are returned ColdFusion creates the following arrays as Form variables to return edits to grid rows and cells: Array reference.

BUDDHA JAYANTI TRIPITAKA PDF

Questions tagged [cfgrid]

.

DDS SANGBOG PDF

Subscribe to RSS

.

CONCEPTUAL PHYSICS 11TH EDITION PAUL G. HEWITT PDF

Using CFGRID to Create Grids ColdFusion Help

.

GUNKS GUIDE PDF

cfgridupdate

.

Related Articles