0

Using a table as a data source makes Spry easy

Spry

As you may know Spry is a JavaScript library developed by Adobe and provides functionality for some extremely cool JavaScript interfaces.  For data sets it easily allows you to implement paganation, filtering and sorting, over at RIAForge the search page is powered by Spry and is one of the best examples I have seen.

Up until version 1.5 Spry needed data in XML format.  1.5, adds JSON and, more interestingly the ability to load a dataset from an HTML table.  Read the technical details here.  Now, I can output a query in XML format or JSON but the ratio of XML or JSON I've written to HTML tables is probably 1 to 1,000 or even 10,000.  I know more shortcuts for writing a query in a table for instance, I'm more comfortable using cfoutput and the group attribute with a table.  Now, there may be good reasons to use XML or JSON if the data is shared with a webservice, etc but overall I like the simplicity that comes with using a table for the data source.

Another advantage of using a HTML table is that Spry can start processing the data when the page loads.  With XML and JSON Spry makes a new request via AJAX to the server to get the data which, depending on connection speeds, means the page can appear to pause.

tags:
Spry

Search

Sam  Farmer