-
1. Re: New Spry Widgets
Arnout Kazemier Jan 6, 2010 11:57 PM (in response to Phil_W)A year ago I released a double featured article on insideRIA on creating your own custom slide menu. Using SpryDOMUtils.js and SpryEffects.js
Part 1: http://www.insideria.com/2009/02/creating-your-own-side-bar-wid.html
Part 2: http://www.insideria.com/2009/02/creating-your-own-side-bar-wid-1.html
So that would hopefully give you insights in how to easily create your own custom widgets.
It might also be wise to read the Spry primer:
http://labs.adobe.com/technologies/spry/articles/spry_primer/index.html
And the widget primer for understanding the Spry widgets model:
http://labs.adobe.com/technologies/spry/articles/spry_widget_model/index.html
Spry Effect coding:
http://labs.adobe.com/technologies/spry/articles/effects_coding/index.html
As for creating widgets for Dreamweaver I would really advice Donald Booth widget packer which is also available on the Adobe labs site:
http://labs.adobe.com/wiki/index.php/Dreamweaver_Widget_Packager
And extending the Spry Element selector for if you are interested in building extension for the Spry element selector:
http://groups.adobe.com/posts/15bd45fd3d
But the most important thing.. Don't hesitate to ask questions, I have build a quit few Spry plugins my self (public and private releases).
-
2. Re: New Spry Widgets
Phil_W Jan 7, 2010 4:33 PM (in response to Arnout Kazemier)Hi,
Thanks I've been reading up on prototype which is commonly used in the Spry functions. From what I've read every function has a prototype property and it can be used to add additional properties and methods to that function. As soon as you create a new instance using the constructor / function those properties and methods as available for the new object..
So if I wanted to extend Spry Datasets I could do a simple function such as below to return the last row of the dataset
Spry.Data.DataSet.prototype.lastRow = function()
{
var rows = this.data;
var len = rows.length;
return rows[len];
}
var mydataset = new Spry.Data.XMLDataSet("xml/weather.xml", "rss/channel");
var latestForecast = mydataset.lastRow()
Anyway I have a go at rewiting some of the simpler stuff I've done in the Spry mold following some of the links you provided. My first little projects are a Spry Cookie handler, Spry Data aware calendar, and a Spry calculator so I can practice the techniques..
Cheers
Phil.
-
3. Re: New Spry Widgets
Arnout Kazemier Jan 7, 2010 11:55 PM (in response to Phil_W)Spry cookie as in : go.spry-it.com/cookie ?
One remark on the code you posted above.
To actually get the last row it would be len - 1, as arrays are zero based.
Spry.Data.DataSet.prototype.lastRow = function() { var rows = this.data; var len = rows.length; return rows[ len - 1]; }And you could even write that function more effective.
Spry.Data.DataSet.prototype.lastRow = function(){ return this.data[ this.data.length - 1 ]; }This way no variables are created resulting a smaller, and faster piece of code.
Anyways good luck with your lil projects
-
4. Re: New Spry Widgets
Phil_W Jan 8, 2010 11:24 AM (in response to Arnout Kazemier)So that's a cookie module copied! - now I'll move onto my other little projects.
Cheers for the tips
Phil


