Hi Werschinger,

First of all - thank you for the help.

Schnemi - thank you too. I've read topic you posted link, but method
mentioned there works only with divs, but not other html elements.
It's my fault that in question I asked for div elements but not for
*any* - I just wanted to make things much more simple.
In my real application I had to update 2 or 3 table rows with an ajax
link and wanted to skip writing id for every table row.

Werschinger, your code looks fine and I'll give it a try, but will
have to read a bit more for prototype framework.


On Sep 24, 11:14 am, Werschinger <[email protected]> wrote:
> In cases like this (and also other cases), I typically do not rely on
> Cake's built-in ajax functions. What I'd do if I were in your
> position:
>
> * Create my own JS-functions that handle the deletion of an email.
> * Have the delete action do the deletion and return whatever data you
> need in JSON format
> * With the JSON data, take care of updating the corresponding divs.
>
> Pros
> Less redundancy, i.e. you don't have things like
> ---
> Event.observe('link2116879578', 'click', function(event) { new
> Ajax.Updater(document.createElement('div'),'/taxundo/Emails/delete',
> {asynchronous:true, evalScripts:true, requestHeaders:['X-Update',
> 'div1 div2']}) }, false);
> ---
> for each ajax call but rather just
> Event.observe('link2116879578', 'click', function(event) { myCustomFxn
> () }
> or
> <yourtag id="link2116879578" onclick="myCustomFxn()" ...>delete me</
> yourtag>
>
> This gives you more flexibility.
>
> Cons: it's a little more overhead but well worth it in the end, I
> think.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to