ColdFusion 9.0 Resources |
cfsprydatasetSyntax<cfsprydataset bind = "bind expression" name = "data set name" onBindError = "JavaScript function name" options = "Spry options object" type = "xml|json" xpath = "XPath expression"> Note: You
can specify this tag’s attributes in an attributeCollection attribute
whose value is a structure. Specify the structure name in the attributeCollection attribute
and use the tag’s attribute names as structure keys.
Attributes
UsageUse this tag to use a bind expression to dynamically create the contents of a Spry XML or JSON data set based on the value of a ColdFusion control or another Spry data set. To create a Spry data set without using a bind expression, use the Spry.Data.JSONDataSet() and Spry.Data.XMLDataSet() JavaScript functions. This tag cannot create a Spry HTML data set. To use a filter to select the contents of a JSON data set from a JSON expression, specify a path or subpath option in the options attribute. For example, to create a Spry JSON data set by using only the items.item element from the JSON data, use a tag such as the following: <cfsprydataset name="theItems" type="json" bind="CFC:dataMgr.getdetails(prodname={myform:mygrid.TITLE})" options="{path: 'items.item.'}"> ExampleThe following cfsprydataset tag updates the dsProduct Spry XML data set by calling the GridDataManager.getProductDetails CFC function each time the selected row in the bookgrid control changes. It passes the TITLE field of the selected row to the CFC function as a prodname parameter. For a complete example that uses this tag, see Using Spry with ColdFusion in the Developing ColdFusion Applications. <cfsprydataset name="dsProduct" type="xml" bind="CFC:GridDataManager.getProductDetails(prodname= {bookform:bookgrid.TITLE})" xpath="products/product" options="{method: 'POST'}" onBindError="errorHandler"> |