ColdFusion 8 - Spry Integration

Anyone who attended one of Ben Forta's sessions on the Scorpio tour knows that one of the keys to ColdFusion 8 is integration (.NET integration, PDF integration, etc). One of the coolest (IMO) integration features is the cfsprydataset tag. This tag will create a simple Spry dataset in any ColdFusion page without the developer having to bother including the Spry libraries or manually declare the dataset. One simple tag changes this:

   <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
   <title>Spry Example</title>
   <!--Link the Spry libraries-->
   <script type="text/javascript" src="../spry/includes/xpath.js"></script>
   <script type="text/javascript" src="../spry/includes/SpryData.js"></script>
   <!--Create a data set object-->
   <script type="text/javascript">
      var dsSpecials = new Spry.Data.XMLDataSet("dsData.cfm", "specials/menu_item");

To this:

<cfsprydataset bind="url:dsData.cfm" name = "dsSpecials" type = "xml" xpath = "specials/menu_item">

Very cool. What's cooler is that you can treat this dataset just like any other Spry dataset - sort it, filter it, etc.

This post contains references and/or code samples from the public beta of ColdFusion 8 (Scorpio). The features and code here are subject to change and may not work in the final release of ColdFusion 8. Use at your own risk.  
上一篇ColdFusion 8: All the New Tags
想对作者说点什么? 我来说一句


2011年08月14日 2KB 下载