Re: Ajax Pagination not working ?
The strange thing is that when I inspect with chrome, the script seems to be there :
There's an error : Uncaught ReferenceError : $ is not defined
Then the script :
Le vendredi 22 juin 2012 18:03:11 UTC+2, JonStark a écrit :
-- - <script type="text/javascript">
- //<![CDATA[
- $(document).ready(function () {$("#link-187169656").bind("click", function (event){$.ajax({beforeSend:function (XMLHttpRequest) {$("#busy-indicator").fadeIn();}, complete:function (XMLHttpRequest, textStatus) {$("#busy-indicator").fadeOut();}, dataType:"html", evalScripts:true, success:function (data, textStatus){$("#content").html(data);}, url:"\/manager\/users\/timeline\/username\/page:2"});
- Uncaught ReferenceError: $ is not defined
- return false;});
- $("#link-672602788").bind("click", function (event) {$.ajax({beforeSend:function(XMLHttpRequest) {$("#busy-indicator").fadeIn();}, complete:function(XMLHttpRequest, textStatus) {$("#busy-indicator").fadeOut();}, dataType:"html", evalScripts:true, success:function (data, textStatus) {$("#content").html(data);}, url:"\/manager\/users\/timeline\/username\/page:1"});
- return false;});
- $("#link-1178929767").bind("click", function (event) {$.ajax({beforeSend:function(XMLHttpRequest) {$("#busy-indicator").fadeIn();}, complete:function(XMLHttpRequest, textStatus) {$("#busy-indicator").fadeOut();}, dataType:"html", evalScripts:true, success:function (data, textStatus) {$("#content").html(data);}, url:"\/manager\/users\/timeline\/username\/page:2"});
- return false;});
- $("#link-809703014").bind("click", function (event) {$.ajax({beforeSend:function(XMLHttpRequest) {$("#busy-indicator").fadeIn();}, complete:function(XMLHttpRequest, textStatus) {$("#busy-indicator").fadeOut();}, dataType:"html", evalScripts:true, success:function (data, textStatus) {$("#content").html(data);}, url:"\/manager\/users\/timeline\/username\/page:4"});
- return false;});
- $("#link-1406013841").bind("click", function (event) {$.ajax({beforeSend:function(XMLHttpRequest) {$("#busy-indicator").fadeIn();}, complete:function(XMLHttpRequest, textStatus) {$("#busy-indicator").fadeOut();}, dataType:"html", evalScripts:true, success:function (data, textStatus) {$("#content").html(data);}, url:"\/manager\/users\/timeline\/username\/page:4"});
- return false;});});
- //]]>
- </script>
Le vendredi 22 juin 2012 18:03:11 UTC+2, JonStark a écrit :
I don't understand why ajax pagination won't work on my app.In my Users controller :<?php
class UsersController extends AppController {
public $name = 'Users';
public $helpers = array('Html', 'Form', 'Paginator', 'Js');
public $components = array('RequestHandler');In my layout :<!-- Javascript -->
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery. " type="text/javascript"></min.js script>
<!-- Loading gif -->
<?php echo $this->Html->image('loading.gif', array('id' => 'busy-indicator')); ?> And in User/view.ctpA div with Id "post"<div id="posts"> Content to paginate </divThe pagination :<?php $this->Paginator->options(array(
'update' => '#posts',
'evalScripts' => true,
'before' => $this->Js->get('#busy-indicator')->effect('fadeIn', array('buffer' => false)),
'complete' => $this->Js->get('#busy-indicator')->effect('fadeOut', array('buffer' => false)),
)); ?>
<div style="text-align: center;">
<?php
if ($this->Paginator->hasPage(2)) {
echo $this->Paginator->prev();
echo (" | ");
} ?>
<?php echo $this->Paginator->numbers(); ?>
<?php
if ($this->Paginator->hasPage(2)) {
echo (" | ");
echo $this->Paginator->next();
} ?>
<?php echo $this->Js->writeBuffer(); ?>
</div>But this ouputs the standard HTML paginator... I'm lost here.Any idea ? Thanks a lot.
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+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php
0 Comments:
Post a Comment
Subscribe to Post Comments [Atom]
<< Home