Thank you! That worked. Resulting code can found below for anyone
interested.
Nagendra
<?php echo $ajax->div('AjaxQuickSaveChapterID'); ?>
<?php echo "<p>$QuickSaveChapterID</p>"; ?>
<?php echo $ajax->divEnd('AjaxQuickSaveChapterID'); ?>
<?php echo $ajax->div('AjaxQuickSaveResult'); ?>
<?php echo "<p>$QuickSaveResult</p>"; ?>
<?php echo '<script type="text/
javascript">CopyAjaxChapterQuickSaveOutputToForm(); </script>' ?>
<?php echo $ajax->divEnd('AjaxQuickSaveResult'); ?>
echo $ajax->link(
'QuickSave',
'/chapters/quicksave',
array(
'update' => array
('AjaxQuickSaveChapterID',
'AjaxQuickSaveResult'),
'loaded' =>
'CopyAjaxChapterQuickSaveOutputToForm()'
)
);
Nagendra
On Jul 17, 12:35 am, "Dr. Loboto" <[email protected]> wrote:
> If you want to do some JavaScript after divs populating with data,
> simplest way is just add this code into AJAX result.
>
> On Jul 17, 11:33 am, qualityvalue <[email protected]> wrote:
>
> > I am having a tough time getting Ajax callbacks to work. I am calling
> > a controller action which updates couple of divs. I can see that the
> > divs get updated after the ajax call. However, I want a call back to
> > be called after the divs have been updated. This javascript callback
> > simply tries to display the ajax result (this ofcourse will be a
> > something more useful later). However, it looks like the javascript
> > callback always displays the value of the divs before they are updated
> > by Ajax.
>
> > Below is the ajax call to echo the link. I have tried loaded, before,
> > after,...etc and all of them seem to work the same way. Any ideas?
> > Following is the view code that I am using. This is cakephp 1.2.
>
> > View
> > ++++
> > echo $ajax->div('AjaxQuickSaveChapterID');
> > echo "<p>234</p>";
> > echo $ajax->divEnd('AjaxQuickSaveChapterID');
>
> > echo $ajax->div('AjaxQuickSaveResult');
> > echo "<p>abc</p>";
> > echo $ajax->divEnd('AjaxQuickSaveResult');
>
> > echo $ajax->link(
> > 'QuickSave',
> > '/chapters/quicksave',
> > array(
> > 'update' =>
> > array('AjaxQuickSaveChapterID',
> > 'AjaxQuickSaveResult'),
> > 'loaded' =>
> > 'CopyAjaxChapterQuickSaveOutputToForm()'
> > )
> > );
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---