On Aug 21, 2010, at 3:13 AM, Mariano C. wrote:
> I have followed perfectly this guide (
> http://mark-story.com/posts/view/creating-simple-ajax-pagination-with-cakephp-1-3-and-mootools
> ) but it only works at 50%.
>
> I just have two link for pagination: 1 & 2. If I go to:
> htp://my_web.com/items/user/page:1 the link to second page is active,
> thus if I click this link the second page will be opened in ajax
> style. OK!
>
> Now, link for page 2 is disabled and link to the first page is active,
> but, if I click this link the page will be reloaded entirely as normal
> call.
>
> Viceversa happen if I call htp://my_web.com/items/mariano/page:2.
> Clicking on link 1 will load new page in AJAX, successivly clicking on
> page 2 will happen with classic call.
>
> Why?
I ran into this same issue. You *must* include your call to $js->writeBuffer()
within the view that gets rendered with each ajax request. Otherwise, after
your first click of an ajax link, the new set of links that get loaded from the
ajax request don't get updated with the custom onclick events.
So, for example, I have a table element that has the option to be shown on each
ajax request. At the bottom of the element file, I have the appropriate call....
<?php
if (isset ($attr['paginate']) && $attr['paginate'] == true) {
echo $js->writeBuffer(array('onDomReady'=>false));
}
?>
Now, each time the new ajax page loads, the links get updated.
Hope that helps.
~Philip
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