-
1. Re: Execute code after Spry region redrawn / added to DOM
Arnout Kazemier Oct 20, 2009 12:02 PM (in response to Phil_W)You got different kind of observers in Spry Data.
- Dataset observers:
datasetname.addObserver( observer )
- Spry Region Observers:
Spry.Data.Region.addObserver( 'region-id', observer );
The dataset observers send out notifications when there is a event happening inside the Spry Data Sets. The one you mentioned is part of this (onPostLoad). These are great to monitor your data changes, but in your case. You don't want to use these.
The Spry region observers respond to events that are happening in side the region. For example onPreUpdate, this event is called when the region is about to generate / insert new markup in to your region. But you also got the onPostUpdate. This is the observer you are looking for, it gets called once the region has re-generated its code / html. It gets fired directly after the new HTML has been inserted.
Small note about the region observers, these require a id= attribute. This id attribute must be placed on the same element as the spry:region. To learn, and read more about the observers i would like to referrer you to this article:
Its rather large, but using the browser build in find function you should be able to locate the sections about the observers
Hopes this helps,


