This post is more than 2 years old.
Mark from NZ had an interesting question about Spry:
I have a question regarding Spry, I have a simple dataset, one of the columns is a simple publish button, if on it displays a green image if off red etc. I was wondering if I can create an ajax call whenever the image is clicked it updates the database and dataset to show my changes. At the moment, when it is clicked it browses away from the page performs the update then a cflocation to take you back to show the changes which is a bit cumbersome.
Absolutely! First off - Spry can do calls back to the server for any number of purposes. Sending data back as a FORM post is relatively simple. First start off by reading:
This will cover how you can send you data updates back to the server. How do you then refresh the current dataset? The Spry Dataset object has a loadData() method that - well - loads the data. One typical use case is to tweak the URL and reload the data:
dsData.url = "/index.cfm?event=xml.starbuckisntdead"; dsData.loadData();
loadData() by itself should be all you need, but if you run into IE caching issues than you could do the old random number in the URL trick.