Example 2: 56,000 place names
Features of this example:
- Managing a large number of records.
- Using a database view to combine the results from two tables. The data in the description column comes from a separate database table that is joined by the 'vPlaces' view.
- Query caching using the
cachedwithinattribute. - The 'glacier_crimson' skin.
- Locale-specific formatting for 'English (US)' (change this using the selector at bottom right).
Source code for this example <!--- Note that the database for this example must be set up as a datasource first. The Microsoft Access database is located in the examples folder. Place the datasource name in the request.dsn variable. Microsoft Access is not recommended for web purposes, and is provided here for demonstration purposes only. Better performance will be achieved with enterprise databases. ---> <cfimport prefix="esw" taglib="../customtags/eswsoftware/"> <cfif structKeyExists(url, "relatedId")> <cfoutput><p>Record selected: #htmlEditFormat(url.relatedId)#</p></cfoutput> </cfif> <esw:sortableplus link="example2.cfm?relatedid=##relatedid##" table="vPlaces" dbms="Microsoft Access" datasource="#request.dsn#" sortBy="pointname" key="relatedid" style="width : 600px" cachedwithin="#createTimeSpan(0, 0, 10, 0)#" skin="glacier_crimson" > <esw:column column="relatedid" caption="ID" type="numeric" /> <esw:column column="pointname" caption="Name" /> <esw:column column="pointdescriptionname" caption="Description" /> <esw:column column="Latitude" type="numeric" mask=".00" /> <esw:column column="Longitude" type="numeric" mask=".00" /> </esw:sortableplus>
To run the example, you will need to:-
- Add the Microsoft Access database as a ColdFusion datasource.
- Modify the path in the
cfimportstatement at top.
