Where in the code you get the returned data and try to put it in the page?

On Tue, Nov 22, 2011 at 1:31 PM, jason for <jsnfo...@googlemail.com> wrote:

> Hi folks,
> I'm almost done with my 1st cakephp site and it's looking good, but
> could look better with a bit of javascript dynamically changing my
> view.
> Here's my code;
>
> $(document).ready(function()
> {
>        $("#event_id").change(function()
>        {
>                $.post(
>                        "manualpayment",
>                        {value: "12" });
>        });
> });
>
> class AccountsController extends AppController {
>
>        var $name = 'Accounts';
>        var $helpers = array('Js' => array('prototype', 'scriptaculous.js?
> load=effects'), 'Ajax', 'Form', 'Html');
>        public $components = array('RequestHandler');
>
> <SNIPPED>
>
>        function manualpayment()
>        {
>
> <SNIPPED>
>
>                if ($this->RequestHandler->isAjax())
>                {
>                        $players = $this->Account->Player->find('list');
>                        $this->set(compact('players', 'events'));
>
>                        echo $this->render('/accounts/manualpayment',
> 'ajax');
>       CakeLog::write('debug', "isAjax is true");
>                }
>                else
>                {
>
>
> I'm trying to handle the ajax request in function manualpayment(). The
> request does reach here as I can see the 'isAjax is true' in the debug
> log. However, I don't get the a new view rendered, in fact, the call
> to render appears to have no effect. I've stored the output from the
> render call in the debug log and it contains a bunch of HTML.
>
> I've done plenty of digging into other articles about AJAX and cakephp
> and the majority of the problems appear to be getting duplicate HTML
> into the view, my problem is the opposite, nothing appears to change!
>
> EDIT: Just checked firebug and it looks like there is a duplicate set
> of view data returning to the browser, but it's still not being drawn
> on the browser (either firefox or IE)
>
> Hopefully someone out there can help. I'm pulling my hair out!
>
> Thanks,
>
> Jason.
>
> --
> Our newest site for the community: CakePHP Video Tutorials
> http://tv.cakephp.org
> Check out the new CakePHP Questions site http://ask.cakephp.org and help
> others with their CakePHP related questions.
>
>
> To unsubscribe from this group, send email to
> cake-php+unsubscr...@googlegroups.com For more options, visit this group
> at http://groups.google.com/group/cake-php
>

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php

Reply via email to