Hi everyone,
there is sth that I just dont understand. Obviously, JQuery prevents
the AJAX helper from working out. This is what I do:
Imagine a form to upload your files. You press the "upload" button,
your file gets uploaded and a view is rendered in a DIV to show you,
what files you already uploaded. behind each file is a link to delete
it, since you might want to do that. You hit "delete", the DIV reloads
again, and the view is rendered again, showing the current files
uploaded. but not the one you just deleted :)
I implemented the uploading process with JQuery. When u hit the
"upload" button from the form a Jquery function is called that passes
the file data to my controller, that renders the view, showing all
files uploaded.
1) JQuery:
ajaxUpload(form,'processAttachment','attachments_content','<img src=
\'../img/icons/loader.gif\' width=\'16\' height=\'16\' border=\'0\' /
>','Fehler beim Upload');
2) controller function "processAttachement" for uploading and
rendering the view
$AttachmentFiletype = $this->Attachment->uploadAttachment($this->data,
$this -> Session -> read('Linkable.eyed'));
$this->renderattachment();
3) the "delete" function is realized with the AJAX helper in the view,
just rendered
echo $ajax->link('delete', '/links/deleteattachment/'.
$attachment['LinksTmp']['name'],
array('update' => 'divi',
'before' => 'startLoading()',
'complete' => 'endLoading()')
);
Now. If I hit "delete" NOTHING happens.
BUT as soon as I quit using jquery to upload the files and just render
the view by clicking a simple button, the whole deleting works. the
file gets deleted and the view is rendered in this DIV.
so how is it possible, that JQuery and AJAX wont cooperate?
Check out the new CakePHP Questions site http://cakeqs.org and help others with
their CakePHP related questions.
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