Adobe ColdFusion 8

WddxRecordset object

Includes functions that you call as needed when constructing a WDDX record set. For more information on using this object, see "Using WDDX" in the ColdFusion Developer's Guide.

Functions

Function syntax

Description

object.addColumn(name)

Adds a column to all rows in a WddxRecordset instance.

object.addRows(n)

Adds rows to all columns in a WddxRecordset instance.

object.dump(escapeStrings)

Displays WddxRecordset object data.

object.getField(row, col)

Returns the element in a row/column position.

object.getRowCount()

Indicates the number of rows in a WddxRecordset instance.

object.setField(row, col, value)

Sets the element in a row/column position.

object.wddxSerialize(serializer)

Serializes a record set.

:

Returns

HTML table of the WddxRecordset object data.

Usage

Convenient for debugging and testing record sets. The boolean parameter escapeStrings determines whether <>& characters in string values are escaped as &lt;&gt;&amp; in HTML.

Example

<!--- Create a simple query ---> 
<cfquery name = "q" datasource ="cfdocexamples"> 
    SELECT Message_Id, Thread_id, Username, Posted 
    FROM messages 
</cfquery> 
<!--- Load the wddx.js file, which includes the dump function ---> 
<script type="text/javascript" src="/CFIDE/scripts/wddx.js"></script> 
<script> 
// Use WDDX to move from CFML data to JS 
<cfwddx action="cfml2js" input="#q#" topLevelVariable="qj"> 
// Dump the record set 
document.write(qj.dump(true)); 
</script>