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
-~----------~----~----~----~------~----~------~--~---