The custom tag that creates the table.
| Attribute | Required? | Description |
|---|---|---|
| template | required | If you are using cfmodule syntax. |
| queryname | required | Use this tag to specify the name of the query that contains the data for the table. |
| columnnames | required | Specify the names for the columns in the table. |
| valuefield | required | Specify the names of the fieldnames contained in the Query that will be in the columns. |
| includebottomspace | optional | Default is Yes. Provides a space below the table. |
| addnavigation | optional | Default is No. Adds the navigation to the table allowing you to break up the output to multiple views. |
| includesearch | optional | Default is No. Puts a search box at the top of the page. |
| tablewidth | optional | Specifies the table width of the main table. If not specified it will be as wide as it needs to be. Can be either pixels or percentage. |
| editlinks | optional | Creates quick edit links to the table. |
| linkurlvalues | optional | Specify the field name you need to add to the url. Required if you are using the Linkfields ActionLinks, or Editlinks |
| totalrowsqueryname | optional | Use this tag to specify the query name of the query that generates a total record count. |
| searchtablewidth | optional | Use this tag to specify the table width of the search box. If not specified it will be as wide as it needs to be. Can be either pixels or percentage. |
| fieldsort | optional | Allows you to sort on the column. The number of elements in this has to match the number of columns specified in columnnames. (ex. "Y,Y,N") |
| linkfields | optional | Allows you to link from the element in this column to a different page. The number of elements in this has to match the number of columns specified in columnnames. (ex. "Y,Y,N") |
| linkurls | optional | Required if you are using the Linkfields. Specify the URL of the page you are trying to link to. The number of elements in this has to match the number of columns specified in columnnames. (ex. "Home.cfm,Index.cfm,About.cfm") |
| actionlinks | optional | Use this to create any links in the last action column. Specify the URL's of the links you want to create. (ex "home.cfm,about.cfm") |
| actionlinknames | optional | Required if you are using the above Actionlinks. Specify the names of the links. If you specify "delete", it will automatically insert the confirmation javascript. |
| columnvalueformat | optional | Will format a field in the table. The only two formats available are 'Currency' and 'Date'. The number of elements in this has to match the number of columns specified in columnnames. (ex. "N,N,Currency") |
There is no initial setup unless you are using fieldsort, includesearch or addnavigation.
You just need to specify the queryname, columnnames, and valuefield to get a basic table.
fieldsort:
<cfif isdefined('url.sort')>
#url.sort# #url.direction#
<cfelse>
fullname
</cfif>
includesearch (include as many fields as you want to search)
<cfif isdefined('url.search')>
Where
<cfloop list="#url.search#" index="si">
lastname like '%#si#%' or firstname like '%#si#%' or email like '%#si#%'
</cfloop>
</cfif>
addnavigation
Include this within your main query at the bottom: Limit #cfstartpointx#,#navigationrows#
You need to have a separate query whose sole purpose is to get a total recordcount (include the name in the totalrowsqueryname attribute)
Iinclude this above the queries:
<cfparam name="url.start" default="1">
<cfset navigationrows = 3>
<cfset cfstartpointx = #url.start# - 1>