On Fri, Mar 31, 2006 at 02:13:11PM -0600, Ryan Gahl wrote:
> > Here's where I get lost.  The event fires and then I free up the
> > event bound to that element.  Where's the list of other events to
> > free up before starting the ajax call?
> 
> This is why you should always keep handles to your event handlers, and
> making autonomous widgets is so important (each widget knows which
> events it has tied to which elements, and therefore knows how to clean
> itself up).

Ah, I see the confusion.  With your code example I now see what you
are saying.

My current setup is not that organized, I guess.  I think I'm trying
to accomplish something in a more generic way.

For example, I generate a table with a template.  That table might
include links in the headers to sort by each column. I have a template
macro that creates those links, and the macro has a flag to indicate
if it should also generate the code for an ajax request.  The IDs are
generated on the fly, so I don't know them ahead of time, and I don't
know which or how many links will have events until the page is
generated.

So, that doesn't lend itself to defining the object ahead of time.
Maybe I need to rethink the design in a way that does.

Maybe I could walk the DOM and look for events inside of the <div>
that's about to be updated and remove those before making the ajax
call.

Thanks for the help.



-- 
Bill Moseley
[EMAIL PROTECTED]

_______________________________________________
Rails-spinoffs mailing list
[email protected]
http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs

Reply via email to