User Guide

1096 Chapter 9: WDDX JavaScript Objects
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>
addColumn
Description
Adds a column to all rows in a WddxRecordset instance.
Syntax
object.addColumn( name )
Parameters
Return value
None.
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.
Parameter Description
object Instance name of the WddxRecordset object
name Name of the column to add
Function syntax Description