Re: ajax pagination

2016-01-07 Thread euromark
See http://sandbox3.dereuromark.de/sandbox/ajax-examples

Mark


Am Dienstag, 5. Januar 2016 10:21:29 UTC+1 schrieb Kamlesh Gupta:
>
> Hello,
>
> I am facing a problem of pagination in cakephp 3.14..
>
> How can we make a ajax pagination in cakephp 3.1.4
>
> would anyone please help me.
>

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at https://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.


ajax pagination

2016-01-05 Thread Kamlesh Gupta
Hello,

I am facing a problem of pagination in cakephp 3.14..

How can we make a ajax pagination in cakephp 3.1.4

would anyone please help me.

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at https://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.


Re: cakephp ajax pagination

2015-07-13 Thread euromark
There are many different (and easy ways),
IMO the best way would be one that also allows a fallback (non js in case 
js is broken or for google bot etc)
see http://sandbox3.dereuromark.de/sandbox/ajax-examples/pagination for an 
example in cake3.

mark


Am Sonntag, 12. Juli 2015 13:23:07 UTC+2 schrieb Daniel Uche:
>
> I am trying to do an ajax pagination in cakephp 3.0 but for some reason i 
> can't get around it
>

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.


cakephp ajax pagination

2015-07-12 Thread Daniel Uche
I am trying to do an ajax pagination in cakephp 3.0 but for some reason i 
can't get around it

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.


ajax pagination using datatables

2014-06-20 Thread Niranga Perera
is there a good example for ajax pagination using datatable plugin.
The example in the documentation is not clear enough in areas like how to 
set the number of rows to display.
sort and pagination is not working.

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.


Creating Ajax Pagination with Cakephp 2.3.x

2013-06-18 Thread cyletech
Hello dear,

I  created ajax pagination with cakephp 2.3.x but it does not work. i
describe how i did following.
*Note:* i am about creating pagination in PagesController.

/in AppController:/


/in PagesController:/


/in Pages/ajax.ctp/


/in Layouts/default.ctp/
*Note:* There is no error or warning on console.
*Note:* Defined selector exists and works.
*Note:* writeBuffer() works and it adds 

Re: Ajax Pagination with Filter Plugin Problem

2013-06-07 Thread Sanjeev Divekar
Thanks Yorick,

Can you explain a bit more.?

Regards,


On Fri, Jun 7, 2013 at 1:02 AM, Yorick Horrie wrote:

> Hi,
>
> Don't know if you found this allready, but for those who are reading this
> and have the same problem.
> This solution works:
>
> $('body').on('click','#yourSelector',function(event) {//do somethings
> here});
>
> You need to stick the event on the body (or any other parent dom object
> that is not updated, using body is the safe way), so the event still works
> if html is added by an ajax request.
>
> Op dinsdag 10 juli 2012 05:18:55 UTC+2 schreef Sanjeev Divekar het
> volgende:
>>
>> I have already tried this but not working.
>>
>> On Mon, Jul 9, 2012 at 10:50 PM, lowpass  wrote:
>>
>>> On Mon, Jul 9, 2012 at 12:20 AM, sanjeev  wrote:
>>> > Fist Time it works but after div updated submit click doesn't work. I
>>> think
>>> > click event lost.
>>>
>>> Yes, that's likely the problem. I've never used livequery so could not
>>> say for sure. I think it should be sufficient to either use JQuery's
>>> live() or create a callback that is run when the content loads that
>>> initiates the event handler. But you're using Cake's JS helper, which
>>> I never bother with, so I can't say more about that.
>>>
>>> Also, your selector could be made a bit more efficient if you wrap the
>>> links with something rather than have to parse the URL of all links on
>>> the page. Something like:
>>>
>>> $('div.Pagination a, #searchButton')
>>>
>>> --
>>> 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+u...@**googlegroups.com For more options, visit this group at
>>> http://groups.google.com/**group/cake-php
>>>
>>
>>
>>
>> --
>> Warm Regards,
>> Sanjeev
>> http://sanjeevdivekar.**wordpress.com
>>
>  --
> Like Us on FaceBook https://www.facebook.com/CakePHP
> Find us on Twitter http://twitter.com/CakePHP
>
> ---
> You received this message because you are subscribed to a topic in the
> Google Groups "CakePHP" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/cake-php/kNt2K7oezBE/unsubscribe?hl=en.
> To unsubscribe from this group and all its topics, send an email to
> cake-php+unsubscr...@googlegroups.com.
> To post to this group, send email to cake-php@googlegroups.com.
> Visit this group at http://groups.google.com/group/cake-php?hl=en.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>



-- 
Warm Regards,
Sanjeev
http://sanjeevdivekar.wordpress.com

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Re: Ajax Pagination with Filter Plugin Problem

2013-06-07 Thread Yorick Horrie
Hi,

Don't know if you found this allready, but for those who are reading this 
and have the same problem.
This solution works:

$('body').on('click','#yourSelector',function(event) {//do somethings 
here});

You need to stick the event on the body (or any other parent dom object 
that is not updated, using body is the safe way), so the event still works 
if html is added by an ajax request.

Op dinsdag 10 juli 2012 05:18:55 UTC+2 schreef Sanjeev Divekar het volgende:
>
> I have already tried this but not working.
>
> On Mon, Jul 9, 2012 at 10:50 PM, lowpass 
> > wrote:
>
>> On Mon, Jul 9, 2012 at 12:20 AM, sanjeev > 
>> wrote:
>> > Fist Time it works but after div updated submit click doesn't work. I 
>> think
>> > click event lost.
>>
>> Yes, that's likely the problem. I've never used livequery so could not
>> say for sure. I think it should be sufficient to either use JQuery's
>> live() or create a callback that is run when the content loads that
>> initiates the event handler. But you're using Cake's JS helper, which
>> I never bother with, so I can't say more about that.
>>
>> Also, your selector could be made a bit more efficient if you wrap the
>> links with something rather than have to parse the URL of all links on
>> the page. Something like:
>>
>> $('div.Pagination a, #searchButton')
>>
>> --
>> 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+u...@googlegroups.com  For more options, visit 
>> this group at http://groups.google.com/group/cake-php
>>
>
>
>
> -- 
> Warm Regards,
> Sanjeev
> http://sanjeevdivekar.wordpress.com
>

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Ajax Pagination Example

2013-05-30 Thread my123
Hi Guys,

I am a new to CakePHP. I got the basic example running in my local 
environment. I need to implement Ajax based pagination of search results 
returned from a database query. I have been unsuccessfully searching the 
internet for a simple ajax pagination CakePHP example. I have lost lot of 
time so far. Since this is a very common requirement for all the websites I 
thought I will find lot of examples but to my surprise i did not. Can you 
please point me to any example that works with the current CakePHP version?

Thanks a bunch,
Muneer

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Re: Ajax Pagination using elements - only each second link is using ajax function

2013-02-14 Thread Michael Bartos
Be sure to render the JavaScript code *outside* of your update DIV.

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Re: Ajax pagination returns the whole page instead of the requested div

2012-09-17 Thread Miqdad Ali
Try this one..

Add this code starting..

layout = '';
 endif;
?>

-
Miqdad Ali K
+919995258790
http://www.miqdadalik.com




On Fri, Aug 31, 2012 at 4:29 AM, darkangel  wrote:

> Did you fix it? I'm facing the same issue :S
>
>
> On Sunday, July 1, 2012 12:27:27 PM UTC-6, JonStark wrote:
>
>> Thanks for the head up !
>>
>> But still, doesn't solve my problem :(
>>
>> Whenever I try to paginate a update just a given div, I get the full
>> layout in response
>>
>> Le dimanche 1 juillet 2012 20:18:10 UTC+2, MaJerle.Eu a écrit :
>>
>>> just use $this->request->is('ajax')
>>>
>>> you don't need to include RequestHandler component.
>>> OFC, you have to be on 2.x cake that will work this :)
>>>
>>> element('posts'); ?>
>>>
>>> why si "" there ?
>>>
>>> --
>>> Lep pozdrav, Tilen Majerle
>>> http://majerle.eu
>>>
>>>
>>>
>>> 2012/7/1 JonStark
>>>
 Hello everyone.

 I'm trying to do a Twitter style auto- load more when scrolling :

  
>
>
>
>
>element('posts'); ?>
>
>
>
>
>
>
>  echo $this->Html->script('jquery', false);
> $maxPage = $this->Paginator->counter('%**pages%');
> ?>
> 
> var lastX = 0;
> var currentX = 0;
> var page = 1;
> $(window).scroll(function () {
> if (page < ) {
> currentX = $(window).scrollTop();
> if (currentX - lastX > 300 * page) {
> lastX = currentX;
> page++;
> $.get('posts/page:' + page, function(data) {
> $('#postList').append(data);
> });
> }
> }
> });
> 
>
>
>Js->writeBuffer(); ?>
>
> This should updates only the div "postList" but it returns the whole
 page in the view. In my controller, I have public $components =
 array('RequestHandler'); activated, and $this->set('isAjax',
 $this->RequestHandler->isAjax(**)); in my function. What am I doing
 wrong ? 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+u...@**googlegroups.com For more options, visit this group at
 http://groups.google.com/**group/cake-php

>>>
>>>  --
> You received this message because you are subscribed to the Google Groups
> "CakePHP" group.
> To post to this group, send email to cake-php@googlegroups.com.
> To unsubscribe from this group, send email to
> cake-php+unsubscr...@googlegroups.com.
> Visit this group at http://groups.google.com/group/cake-php?hl=en-US.
>
>
>

-- 
Like Us on FacekBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com.
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php?hl=en.




Re: Ajax pagination returns the whole page instead of the requested div

2012-08-30 Thread darkangel
Did you fix it? I'm facing the same issue :S

On Sunday, July 1, 2012 12:27:27 PM UTC-6, JonStark wrote:
>
> Thanks for the head up !
>
> But still, doesn't solve my problem :(
>
> Whenever I try to paginate a update just a given div, I get the full 
> layout in response
>
> Le dimanche 1 juillet 2012 20:18:10 UTC+2, MaJerle.Eu a écrit :
>>
>> just use $this->request->is('ajax')
>>
>> you don't need to include RequestHandler component.
>> OFC, you have to be on 2.x cake that will work this :)
>>
>> element('posts'); ?> 
>>
>> why si "" there ?
>>
>> --
>> Lep pozdrav, Tilen Majerle
>> http://majerle.eu
>>
>>
>>
>> 2012/7/1 JonStark
>>
>>> Hello everyone.
>>>
>>> I'm trying to do a Twitter style auto- load more when scrolling :
>>>
>>>  



 
element('posts'); ?>
 



 

 >>> echo $this->Html->script('jquery', false);
 $maxPage = $this->Paginator->counter('%pages%');
 ?>
 
 var lastX = 0;
 var currentX = 0;
 var page = 1;
 $(window).scroll(function () {
 if (page < ) {
 currentX = $(window).scrollTop();
 if (currentX - lastX > 300 * page) {
 lastX = currentX;
 page++;
 $.get('posts/page:' + page, function(data) {
 $('#postList').append(data);
 });
 }
 }
 });
 

 
Js->writeBuffer(); ?>

 This should updates only the div "postList" but it returns the whole 
>>> page in the view. In my controller, I have public $components = 
>>> array('RequestHandler'); activated, and $this->set('isAjax', 
>>> $this->RequestHandler->isAjax()); in my function. What am I doing wrong ? 
>>> 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+u...@googlegroups.com  For more options, visit 
>>> this group at http://groups.google.com/group/cake-php
>>>
>>
>>

-- 
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com.
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php?hl=en-US.




Re: Ajax Pagination with Filter Plugin Problem

2012-07-09 Thread Sanjeev Divekar
I have already tried this but not working.

On Mon, Jul 9, 2012 at 10:50 PM, lowpass  wrote:

> On Mon, Jul 9, 2012 at 12:20 AM, sanjeev  wrote:
> > Fist Time it works but after div updated submit click doesn't work. I
> think
> > click event lost.
>
> Yes, that's likely the problem. I've never used livequery so could not
> say for sure. I think it should be sufficient to either use JQuery's
> live() or create a callback that is run when the content loads that
> initiates the event handler. But you're using Cake's JS helper, which
> I never bother with, so I can't say more about that.
>
> Also, your selector could be made a bit more efficient if you wrap the
> links with something rather than have to parse the URL of all links on
> the page. Something like:
>
> $('div.Pagination a, #searchButton')
>
> --
> 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
>



-- 
Warm Regards,
Sanjeev
http://sanjeevdivekar.wordpress.com

-- 
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


Re: Ajax Pagination with Filter Plugin Problem

2012-07-09 Thread lowpass
On Mon, Jul 9, 2012 at 12:20 AM, sanjeev  wrote:
> Fist Time it works but after div updated submit click doesn't work. I think
> click event lost.

Yes, that's likely the problem. I've never used livequery so could not
say for sure. I think it should be sufficient to either use JQuery's
live() or create a callback that is run when the content loads that
initiates the event handler. But you're using Cake's JS helper, which
I never bother with, so I can't say more about that.

Also, your selector could be made a bit more efficient if you wrap the
links with something rather than have to parse the URL of all links on
the page. Something like:

$('div.Pagination a, #searchButton')

-- 
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


Re: Ajax Pagination with Filter Plugin Problem

2012-07-08 Thread sanjeev
Fist Time it works but after div updated submit click doesn't work. I think 
click event lost.

On Saturday, 7 July 2012 23:24:11 UTC+5:30, cricket wrote:
>
> Please define "doesn't work". 
>
> On Sat, Jul 7, 2012 at 7:44 AM, sanjeev  wrote: 
> > Hello, 
> > 
> > I am using Ajax Pagination with the help of livequery.js with following 
> code 
> > in layout 
> > 
> > $('a[href*="sort:"],a[href*="page:"],#searchButton').livequery('click', 
> > function(){ 
> > $('#content').load($(this).attr('href')); 
> > return false; 
> > }); 
> > I put #searchButton with help of Js::submit() function for search 
> records 
> > which doesn't work 
> > 
> > Thanks in advance. 
> > 
> > Regards, 
> > 
> > Sanjeev Divekar 
> > 
> > -- 
> > 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


Re: Ajax Pagination with Filter Plugin Problem

2012-07-07 Thread lowpass
Please define "doesn't work".

On Sat, Jul 7, 2012 at 7:44 AM, sanjeev  wrote:
> Hello,
>
> I am using Ajax Pagination with the help of livequery.js with following code
> in layout
>
> $('a[href*="sort:"],a[href*="page:"],#searchButton').livequery('click',
> function(){
> $('#content').load($(this).attr('href'));
> return false;
> });
> I put #searchButton with help of Js::submit() function for search records
> which doesn't work
>
> Thanks in advance.
>
> Regards,
>
> Sanjeev Divekar
>
> --
> 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


Ajax Pagination with Filter Plugin Problem

2012-07-07 Thread sanjeev
Hello,

I am using Ajax Pagination with the help of livequery.js with following 
code in layout

$('a[href*="sort:"],a[href*="page:"],#searchButton').livequery('click', 
function(){
$('#content').load($(this).attr('href'));
return false;
});
I put #searchButton with help of Js::submit() function for search records 
which doesn't work

Thanks in advance.

Regards,

Sanjeev Divekar

-- 
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


CakePHP Ajax Pagination

2012-07-05 Thread Ronen Amiel
Hey everyone,

Cake's ajax pagination produces code similar to the following:

> $("#link-1983047312").bind("click", function (event) 
> {$.ajax({dataType:"html", evalScripts:true, success:function (data, 
> textStatus) {$("#tableWrap").html(data);}, 
> url:"\/companies\/index\/page:1"});


Because Cake is using .bind(), after the first ajax request the new ajax 
content doesn't have those events bind to it. And so, when I click on one 
of the pagination links for the second time, I get a page refresh.

I tried looking up for a neat solution and the only one I found is to 
include $this->Js->writeBuffer() and the bottom of my ajax.ctp layout file. 
That will fix it, no problem, but it will cause problems as every time new 
ajax content arrives to the browser, it comes with that whole JavaScript 
code again, and again.

The simplest way to solve it would be to make Cake use .live() rather than 
.bind(). Is there a way to do that without changing any of Cake's core 
files?

Thanks!

-- 
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


Re: Ajax pagination returns the whole page instead of the requested div

2012-07-03 Thread lowpass
I can't speak to the example code you provided as I don't use Cake's
JSHelper for AJAX.

Does the full layout include the data you wanted? Or does it just have
what you'd see when first arriving at the page? Does your controller
action have a redirect? Does the returned HTML include an error or
notice of any kind?

On Sun, Jul 1, 2012 at 2:27 PM, JonStark  wrote:
> Thanks for the head up !
>
> But still, doesn't solve my problem :(
>
> Whenever I try to paginate a update just a given div, I get the full layout
> in response
>
> Le dimanche 1 juillet 2012 20:18:10 UTC+2, MaJerle.Eu a écrit :
>>
>> just use $this->request->is('ajax')
>>
>> you don't need to include RequestHandler component.
>> OFC, you have to be on 2.x cake that will work this :)
>>
>> element('posts'); ?>
>>
>> why si "" there ?
>>
>> --
>> Lep pozdrav, Tilen Majerle
>> http://majerle.eu
>>
>>
>>
>> 2012/7/1 JonStark
>>>
>>> Hello everyone.
>>>
>>> I'm trying to do a Twitter style auto- load more when scrolling :
>>>
  

   
   

   element('posts'); ?>

   
   
   

   
   >>>   echo $this->Html->script('jquery', false);
   $maxPage = $this->Paginator->counter('%pages%');
   ?>
   
   var lastX = 0;
   var currentX = 0;
   var page = 1;
   $(window).scroll(function () {
   if (page < ) {
   currentX = $(window).scrollTop();
   if (currentX - lastX > 300 * page) {
   lastX = currentX;
   page++;
   $.get('posts/page:' + page, function(data) {
   $('#postList').append(data);
   });
   }
   }
   });
   
   

   Js->writeBuffer(); ?>
>>>
>>> This should updates only the div "postList" but it returns the whole page
>>> in the view. In my controller, I have public $components =
>>> array('RequestHandler'); activated, and $this->set('isAjax',
>>> $this->RequestHandler->isAjax()); in my function. What am I doing wrong ?
>>> 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+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

-- 
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


Re: Ajax pagination returns the whole page instead of the requested div

2012-07-01 Thread JonStark
Thanks for the head up !

But still, doesn't solve my problem :(

Whenever I try to paginate a update just a given div, I get the full layout 
in response

Le dimanche 1 juillet 2012 20:18:10 UTC+2, MaJerle.Eu a écrit :
>
> just use $this->request->is('ajax')
>
> you don't need to include RequestHandler component.
> OFC, you have to be on 2.x cake that will work this :)
>
> element('posts'); ?> 
>
> why si "" there ?
>
> --
> Lep pozdrav, Tilen Majerle
> http://majerle.eu
>
>
>
> 2012/7/1 JonStark
>
>> Hello everyone.
>>
>> I'm trying to do a Twitter style auto- load more when scrolling :
>>
>>  
>>>
>>>
>>>
>>> 
>>>element('posts'); ?>
>>> 
>>>
>>>
>>>
>>> 
>>>
>>> >> echo $this->Html->script('jquery', false);
>>> $maxPage = $this->Paginator->counter('%pages%');
>>> ?>
>>> 
>>> var lastX = 0;
>>> var currentX = 0;
>>> var page = 1;
>>> $(window).scroll(function () {
>>> if (page < ) {
>>> currentX = $(window).scrollTop();
>>> if (currentX - lastX > 300 * page) {
>>> lastX = currentX;
>>> page++;
>>> $.get('posts/page:' + page, function(data) {
>>> $('#postList').append(data);
>>> });
>>> }
>>> }
>>> });
>>> 
>>>
>>> 
>>>Js->writeBuffer(); ?>
>>>
>>> This should updates only the div "postList" but it returns the whole 
>> page in the view. In my controller, I have public $components = 
>> array('RequestHandler'); activated, and $this->set('isAjax', 
>> $this->RequestHandler->isAjax()); in my function. What am I doing wrong ? 
>> 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+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


Ajax pagination returns the whole page instead of the requested div

2012-07-01 Thread JonStark
Hello everyone.

I'm trying to do a Twitter style auto- load more when scrolling :

 
>
>
>
> 
>element('posts'); ?>
> 
>
>
>
> 
>
>  echo $this->Html->script('jquery', false);
> $maxPage = $this->Paginator->counter('%pages%');
> ?>
> 
> var lastX = 0;
> var currentX = 0;
> var page = 1;
> $(window).scroll(function () {
> if (page < ) {
> currentX = $(window).scrollTop();
> if (currentX - lastX > 300 * page) {
> lastX = currentX;
> page++;
> $.get('posts/page:' + page, function(data) {
> $('#postList').append(data);
> });
> }
> }
> });
> 
>
> 
>Js->writeBuffer(); ?>
>
> This should updates only the div "postList" but it returns the whole page 
in the view. In my controller, I have public $components = 
array('RequestHandler'); activated, and $this->set('isAjax', 
$this->RequestHandler->isAjax()); in my function. What am I doing wrong ? 
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+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: Ajax Pagination not working ?

2012-06-23 Thread JonStark
Ok you were right it worked !

But there's still a little problem (?) :

The ajax works indeed in the div with the correct ID, but it load the* full 
page* again in the div, meaning I have my full page appearing ... in my 
page. The only way to prevent this is to wrap the entire content in the 
div, but then all the other requests on the page are re-sent too.

Is this the way it's supposed to work, reloading the full page  ?

Thanks a lot for your time.



Le samedi 23 juin 2012 12:31:27 UTC+2, Andras Kende a écrit :
>
> google : "Uncaught ReferenceError : $ is not defined"  this looks like 
> jquery not loaded error…
>
> I would put jquery at the top inside 
> https://ajax.googleapis.com/ajax/libs/jquery/1.7/jquery.min.js"</a>; 
> type="text/javascript">
>
> Andras Kende
> http://www.kende.com
>
>
>
> On Jun 23, 2012, at 2:54 AM, JonStark wrote:
>
> 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 :
>
>
>1. 
>2. //<![CDATA[
>3. $(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"});
>4. Uncaught ReferenceError: $ is not defined<<a  rel="nofollow" href="http://www.php.net/defined">http://www.php.net/defined</a>>
>5. return false;});
>6. $("#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"});
>7. return false;});
>8. $("#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"});
>9. return false;});
>10. $("#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"});
>11. return false;});
>12. $("#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"});
>13. return false;});});
>14. //]]>
>15. 
>
>
> 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 :
>>
>> >> class UsersController extends AppController {
>>> public $name = 'Users';
>>> public $helpers = array('Html', 'Form', 'Paginator', '*Js*');
>>> public $components = array('*RequestHandler*');
>>
>>
>> In my layout :
>>
>> 
>>> >> type="text/javascript">
>>>
>>> 
>>> Html->image('loading.gif', array('id' => 
>>> 'busy-indicator')); ?> 
>>
>>
>> And in User/view.ctp
>>
>> A div with Id "post"
>>
>>  Content to paginat

Re: Ajax Pagination not working ?

2012-06-23 Thread Andras Kende
google : "Uncaught ReferenceError : $ is not defined"  this looks like jquery 
not loaded error…

I would put jquery at the top inside 
https://ajax.googleapis.com/ajax/libs/jquery/1.7/jquery.min.js"</a>; 
type="text/javascript">

Andras Kende
http://www.kende.com



On Jun 23, 2012, at 2:54 AM, JonStark wrote:

> 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 :
> 
> 
> //<![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;});});
> //]]>
> 
> 
> 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 :
> 
>  class UsersController extends AppController {
> public $name = 'Users';
> public $helpers = array('Html', 'Form', 'Paginator', 'Js');
> public $components = array('RequestHandler');
> 
> In my layout :
> 
> 
>  type="text/javascript">
>
> 
> Html->image('loading.gif', array('id' => 
> 'busy-indicator')); ?> 
> 
> And in User/view.ctp
> 
> A div with Id "post"
> 
>  Content to paginate   
> The pagination :
> 
> 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)),
>   )); ?>
>   
>   
>  if ($this->Paginator->hasPage(2)) {
>   echo $this->Paginator->prev();
>   echo (" | ");
>   } ?> 
>   Paginator->numbers(); ?> 
>   

Re: Ajax Pagination not working ?

2012-06-23 Thread JonStark
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 :


   1. 
   2. //<![CDATA[
   3. $(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"});
   4. Uncaught ReferenceError: $ is not defined <<a  rel="nofollow" href="http://www.php.net/defined">http://www.php.net/defined</a>>
   5. return false;});
   6. $("#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"});
   7. return false;});
   8. $("#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"});
   9. return false;});
   10. $("#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"});
   11. return false;});
   12. $("#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"});
   13. return false;});});
   14. //]]>
   15. 
   

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 :
>
> > class UsersController extends AppController {
>> public $name = 'Users';
>> public $helpers = array('Html', 'Form', 'Paginator', '*Js*');
>> public $components = array('*RequestHandler*');
>
>
> In my layout :
>
> 
>> > type="text/javascript">
>>
>> 
>> Html->image('loading.gif', array('id' => 
>> 'busy-indicator')); ?> 
>
>
> And in User/view.ctp
>
> A div with Id "post"
>
>  Content to paginate  >
>
> The pagination :
>
> 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)),
>>)); ?>
>>
>>
>>>if ($this->Paginator->hasPage(2)) {
>>echo $this->Paginator->prev();
>>echo (" | ");
>>} ?> 
>>Paginator->numbers(); ?> 
>>>if ($this->Paginator->hasPage(2)) { 
>>echo (" | ");
>>echo $this->Paginator->next();
>>} ?>
>>
>>Js->writeBuffer(); ?>
>>
>
>
>
>  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+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: Ajax Pagination not working ?

2012-06-23 Thread JonStark
Actually, the pagination is inside the div, I mis-explained in my question, 
so it must not be this...

This is the full code for info :

//rest of the page


  
  
  
  
  
  
  
  
   
 
  
  
  
   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)),
   )); ?>
   
   
   Paginator->hasPage(2)) {
   echo $this->Paginator->prev();
   echo (" | ");
   } ?> 
   Paginator->numbers(); ?> 
   Paginator->hasPage(2)) { 
   echo (" | ");
   echo $this->Paginator->next();
   } ?>

   
  
  
  
   



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 :
>
> > class UsersController extends AppController {
>> public $name = 'Users';
>> public $helpers = array('Html', 'Form', 'Paginator', '*Js*');
>> public $components = array('*RequestHandler*');
>
>
> In my layout :
>
> 
>> > type="text/javascript">
>>
>> 
>> Html->image('loading.gif', array('id' => 
>> 'busy-indicator')); ?> 
>
>
> And in User/view.ctp
>
> A div with Id "post"
>
>  Content to paginate  >
>
> The pagination :
>
> 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)),
>>)); ?>
>>
>>
>>>if ($this->Paginator->hasPage(2)) {
>>echo $this->Paginator->prev();
>>echo (" | ");
>>} ?> 
>>Paginator->numbers(); ?> 
>>>if ($this->Paginator->hasPage(2)) { 
>>echo (" | ");
>>echo $this->Paginator->next();
>>} ?>
>>
>>Js->writeBuffer(); ?>
>>
>
>
>
>  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+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: Ajax Pagination not working ?

2012-06-23 Thread Andras Kende
I think Paginator->numbers, Paginator->next, Paginator->prev has to be inside 
the …..

Andras Kende

On Jun 23, 2012, at 1:54 AM, JonStark wrote:

> No one has a clue ? This is driving me crazy.
> 
> Thanks a lot.
> 
> 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 :
> 
>  class UsersController extends AppController {
> public $name = 'Users';
> public $helpers = array('Html', 'Form', 'Paginator', 'Js');
> public $components = array('RequestHandler');
> 
> In my layout :
> 
> 
>  type="text/javascript">
>
> 
> Html->image('loading.gif', array('id' => 
> 'busy-indicator')); ?> 
> 
> And in User/view.ctp
> 
> A div with Id "post"
> 
>  Content to paginate   
> The pagination :
> 
> 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)),
>   )); ?>
>   
>   
>  if ($this->Paginator->hasPage(2)) {
>   echo $this->Paginator->prev();
>   echo (" | ");
>   } ?> 
>   Paginator->numbers(); ?> 
>  if ($this->Paginator->hasPage(2)) { 
>   echo (" | ");
>   echo $this->Paginator->next();
>   } ?>
>   
>   Js->writeBuffer(); ?>
>   
> 
> 
>  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+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


Re: Ajax Pagination not working ?

2012-06-23 Thread JonStark
No one has a clue ? This is driving me crazy.

Thanks a lot.

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 :
>
> > class UsersController extends AppController {
>> public $name = 'Users';
>> public $helpers = array('Html', 'Form', 'Paginator', '*Js*');
>> public $components = array('*RequestHandler*');
>
>
> In my layout :
>
> 
>> > type="text/javascript">
>>
>> 
>> Html->image('loading.gif', array('id' => 
>> 'busy-indicator')); ?> 
>
>
> And in User/view.ctp
>
> A div with Id "post"
>
>  Content to paginate  >
>
> The pagination :
>
> 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)),
>>)); ?>
>>
>>
>>>if ($this->Paginator->hasPage(2)) {
>>echo $this->Paginator->prev();
>>echo (" | ");
>>} ?> 
>>Paginator->numbers(); ?> 
>>>if ($this->Paginator->hasPage(2)) { 
>>echo (" | ");
>>echo $this->Paginator->next();
>>} ?>
>>
>>Js->writeBuffer(); ?>
>>
>
>
>
>  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+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Ajax Pagination not working ?

2012-06-22 Thread JonStark
I don't understand why ajax pagination won't work on my app.

In my Users controller :

 class UsersController extends AppController {
> public $name = 'Users';
> public $helpers = array('Html', 'Form', 'Paginator', '*Js*');
> public $components = array('*RequestHandler*');


In my layout :


>  src="//ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js" 
> type="text/javascript">
>
> 
> Html->image('loading.gif', array('id' => 
> 'busy-indicator')); ?> 


And in User/view.ctp

A div with Id "post"

 Content to paginate  

The pagination :

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)),
>)); ?>
>
>
>if ($this->Paginator->hasPage(2)) {
>echo $this->Paginator->prev();
>echo (" | ");
>} ?> 
>Paginator->numbers(); ?> 
>if ($this->Paginator->hasPage(2)) { 
>echo (" | ");
>echo $this->Paginator->next();
>} ?>
>
>Js->writeBuffer(); ?>
>



 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+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


tell ajax pagination to order by 3 fields

2012-06-02 Thread heohni
Hi,

I am using the ajax pagination.
I have a default ORDER BY rule like ORDER BY price ASC, upload DESC

So all my results are automatically ordered by this rule.
Fine so far!

But now I have a search form, where I want to add a third sort option like 
"articlegroup"
Users can choose if they want to order articlegroup ASC/DESC.

And it seams, that - if that  articlegroup is selected and my URL looks 
like this:
... /sort:articlegroup/direction:asc
It is overwriting my default ORDER BY values.

I can see that in my sql logs, that the statement only does a ORDER 
BY articlegroup ASC.

Is there a way that I can add my default ORDER rules also into the URL?
Or can I tell the model, that my default rules always apply and other are 
only added behind my default rules?

How can I solve this?
Please help me!


-- 
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


Double Ajax Pagination in same view.

2012-05-17 Thread Sankalp Bohra
I was thinking for double Ajax pagination in same view. Is it possible
in Cakephp2.0. I posted my question here..

http://stackoverflow.com/questions/10615176/double-pagination-using-ajax-in-cakephp

-- 
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


Cake 1.3 Ajax pagination working strange

2012-05-16 Thread Michał Piotrowski
Hello!

In my app I use ajax pagination. In view of actions ones of my controller i 
have code like this:
 $this->Paginator->options(array(
'evalScripts' => true,
 'data'=> "$('#filters').serialize()",
'update' => '#content',
'before' => " $('#loading').fadeIn('fast'); 
 $('#people').fadeOut('fast'); ",
'complete' => $this->Js->get('#loading')->effect('fadeOut', 
array('speed' => 'fast')),
 
));

and 
$this->Paginator->options(array('url' => $this->passedArgs));
...
echo $this->Js->writeBuffer();?


Ajax works fine only to first use, first request looks like this:
http://192.168.1.102/crm/people/by_building/page:2?_method=POST&data%5BApartament%5D%5Bbuilding_id%5D=2021&data%5BApartament%5D%5Bnumber%5D=&data%5BApartament%5D%5Btype%5D=&data%5BApartament%5D%5Brights%5D=&data%5BPerson%5D%5Bsurname%5D=

and this code 'data'=> "$('#filters').serialize()", ajax paginantion works 
fine... next click look like:
http://192.168.1.102/crm/people/by_building/page:3

without serialize... but in page code

$("#link-1244917713").bind("click", function (event) 
{$.ajax({beforeSend:function (XMLHttpRequest) { 
$('#loading').fadeIn('fast');  $('#people').fadeOut('fast'); }, 
complete:function (XMLHttpRequest, textStatus) 
{$("#loading").fadeOut("fast");}, 
*data:$('#filters').serialize(),*dataType:"html", evalScripts:true, 
success:function (data, textStatus) 
{$("#content").html(data);}, 
url:"\/crm\/people\/by_building\/page:1\/sort:type\/direction:asc"});
return false;});
$("#link-1907708576").bind("click", function (event) 
{$.ajax({beforeSend:function (XMLHttpRequest) { 
$('#loading').fadeIn('fast');  $('#people').fadeOut('fast'); }, 
complete:function (XMLHttpRequest, textStatus) 
{$("#loading").fadeOut("fast");}, *data:$('#filters').serialize()*, 
dataType:"html", evalScripts:true, success:function (data, textStatus) 
{$("#content").html(data);}, 
url:"\/crm\/people\/by_building\/page:1\/sort:right\/direction:asc"});
return false;});}); 

Serialize functions exist, but dosen't work and only on Firefox, in Google 
Chrome ajax pagination with data works fine. 

This problem is a Firefox problem or problem is in my app?

-- 
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


Re: Problem with Ajax Pagination

2012-05-15 Thread Jimit Kapadya
Hello

My problem is how to impliment placeholder in cakephp 2.0

-- 
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


Re: Problem with Ajax Pagination

2012-05-15 Thread supp...@deep-coding.net
What should I put in the 'ajax_view.ctp'?

-- 
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


Re: Problem with Ajax Pagination

2012-05-15 Thread neto la'neta
in ur controller u can use:

if($this->request->is('ajax')){
$this->render('ajax_view'); // had to be in the views folder for the 
controller u r using
}

dont include the box u r updating the the ajax view, and keep out of that 
box the links of the paginator helper.

-- 
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


Problem with Ajax Pagination

2012-05-11 Thread supp...@deep-coding.net
Hey there, 

I have a problem again :)
I want to use the ajax Pagination, but it doesn't work 100%.
If I click on next I get the content of the second page with ajax.
But if I click then on next, I get the content of the third page, but 
without ajax, so the page reloads.
If I click then on next, I get the content of the fourth page with ajax.
So on every second page the ajax request doesn't work.
Here is my code:

 $this->Paginator->options(array(
> 'update' => '#rightCol',
> 'evalScripts' => true
> ));
> ?>
> 
>  $this->Paginator->counter();?>
> 
>  echo $this->Paginator->prev('Previous', null, null, 
> array('class' => 'disabled'));
> echo $this->Paginator->numbers();
> echo $this->Paginator->next('Next', null, null, array('class' 
> => 'disabled'));  
> ?>
> 
> 
>
Can anybody help me please?
Thanks 

-- 
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


Re: Ajax Pagination only works once (no javascript loaded)

2012-05-08 Thread Timo Respondek
Thank you for your input, lowpass, and excuse my late reply.

I found out that what I had to do to get it to work the way  I thought
it would work was quite simple - despite my having echo
$this->Js->writeBuffer(); at the end of my default-layout, I've
included the line on every, which of course isn't all too elegant, but
somehow just having it in my default layout doesn't work.


Timo

-- 
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


Re: Ajax Pagination only works once (no javascript loaded)

2012-04-24 Thread lowpass
This works for me:

$(function()
{
initPagination();
});


function initPagination()
{
$('div.PaginationLinks a').live('click', function(ev)
{
ev.preventDefault();

$('#content').loading();// show spinner

// closest() includes current element
var $container = 
$(this).closest('div.PaginationLinks').parent('div');
var s_top = $container.offset().top;

$.ajax({
url: $(this).attr('href'),
dataType: 'html',
success: function(data, textStatus, XMLHttpRequest)
{
var $data = $(data).fadeTo(0, 0.1);

$('#content').loading(false);   // remove 
spinner

$container.animate(
{ opacity: 0.1 },
500,
function()
{   

// why doesn't replaceWith() 
return the new element?!?
$container.replaceWith($data);

// scroll back up
$data.animate(
{opacity:1},
500,
function()
{
$('html, 
body').animate({ scrollTop: s_top }, 'slow', 'swing');
}
);  

}
);
},
error: function(XMLHttpRequest, textStatus, errorThrown)
{
alert(textStatus);
}
});
});
}

On Tue, Apr 24, 2012 at 5:08 AM, Timo Respondek
 wrote:
> Update:
>
> After some questioning in the #cakephp irc channel I've found out or rather
> was pointed to the fact that I'd need to rebind my javascript functions.
> I've done so for other divs that are loaded into the current dom, but how
> would I go about this for my pagination? The links that are created by the
> PaginatorHelper when using Ajax look like this:
>
> $("#link-1983047312").bind("click", function (event)
> {$.ajax({dataType:"html", evalScripts:true, success:function (data,
> textStatus) {$("#tableWrap").html(data);},
> url:"\/companies\/index\/page:1"});
>
> Inside a $(document).ready block at the end of the page. Or rather the links
> should be bound by live() instead of bind(), is there an easy way to do this
> or, alternatively, can someone kindly point me to a Ajax Pagination example
> viable for Cake 2.1?
>
>
> Thanks in advance again
>
>
>
> Timo
>
> --
> 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


Re: Ajax Pagination only works once (no javascript loaded)

2012-04-24 Thread Timo Respondek
Update:

After some questioning in the #cakephp irc channel I've found out or rather
was pointed to the fact that I'd need to rebind my javascript functions.
I've done so for other divs that are loaded into the current dom, but how
would I go about this for my pagination? The links that are created by the
PaginatorHelper when using Ajax look like this:

$("#link-1983047312").bind("click", function (event)
{$.ajax({dataType:"html", evalScripts:true, success:function (data,
textStatus) {$("#tableWrap").html(data);},
url:"\/companies\/index\/page:1"});

Inside a $(document).ready block at the end of the page. Or rather the
links should be bound by live() instead of bind(), is there an easy
way to do this or, alternatively, can someone kindly point me to a
Ajax Pagination example viable for Cake 2.1?


Thanks in advance again


Timo

-- 
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


Ajax Pagination only works once (no javascript loaded)

2012-04-23 Thread Timo
Hello everyone :)

I'm trying to implement Ajax Pagination as described here: 
http://book.cakephp.org/2.0/en/core-libraries/helpers/js.html#ajax-pagination

I've followed all the steps and the ajax loading does work - but only once. 
When I click another page of the table, the whole webpage is reloaded. It 
seems that no javascript is loaded or working after the first pagination 
load, which I can deduce from the fact that other javascript functions do 
not work either (e.g. function to colour the background of even and uneven 
table rows differently doesn't work). How do I solve this? Why does no 
javascript (especially no pagination itself)  work after one pagination 
load via ajax?

Thanks in advance for any advice


Timo

-- 
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


Ajax Pagination using elements - only each second link is using ajax function

2012-03-01 Thread heohni
Hi,

this is my controller:
public function search($searchSingleId = false, $singleId = null) {

if ($this->request->is('ajax')) {
$this->layout = false;
}

  ..snip
$this->set('results', $results);
   

if ($this->request->is('ajax')) {
$this->render('/Elements/paginate-results');
return;
}

}

and this the search.ctp
element('detailsearch'); // this is a search box which should 
stay on the page and should not reload
element('paginate-results'); ?> // here is the search results 
content

and this is paginate-results.ctp
Paginator->options(array(
'update' => '#searchResults',
'evalScripts' => true,
'before' => $this->Js->get('#busy-indicator')->effect('fadeIn', 
array('buffer' => false)),
'complete' => $this->Js->get('#busy-indicator')->effect('hide', 
array('buffer' => false)),
)); ?>

... snip
Paginator->options(array(
'update' => '#searchResults',
'evalScripts' => true,
'before' => $this->Js->get('#busy-indicator')->effect('fadeIn', 
array('buffer' => false)),
'complete' => $this->Js->get('#busy-indicator')->effect('hide', 
array('buffer' => false)),
)); ?>

...snip



The really, really, really strange thing now is that only every second link 
is using the ajax reload.
The links generated to paginate are valid: 1

I am sure there is a hook in my controller and about the structure of the 
templates/elements => but I can't see it??

Please help me out!!

-- 
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


Ajax Pagination busy-indicator will not fadeout

2012-02-24 Thread heohni
Hi,

Is there anybody who know what I have to do hide the busy-indicator
after the results are updated?

On page load the gif is hidden, it fades in on the first ajax call.

$this->Paginator->options(array(
'update' => '#searchResults',
'evalScripts' => true,
'before' => $this->Js->get('#busy-indicator')->effect('fadeIn',
array('buffer' => false)),
'complete' => $this->Js->get('#busy-indicator')->effect('fadeOut',
array('buffer' => false)),
));

Html->image('/img/ajax-loader.gif', array('id' => 'busy-
indicator')); ?>

Everythinh works fine just the gif doesn't hide anymore.

Anyone knows help?

-- 
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


Delete and AJAX pagination with Filter

2012-02-06 Thread Joey Mukherjee
Hello!

I have AJAX pagination working correctly (with form filters!) with one
small problem.  When I delete an entry from my pages, the new URLs for
the pagination controls (i.e. numbers and previous/next) all have
delete as part of the named parameters.  I'm not sure what I am doing
wrong.

Some relevant functions from the controller:

public function delete ($id)
{
if (!$id) {
$this->Session->setFlash (__('Invalid id for
observation.'), 'flash_error');
}
if ($this->Observation->delete ($id)) {
$this->Session->setFlash (__('Observation was deleted.'),
'flash_success');
} else {
$this->Session->setFlash (__('Observation was not
deleted.'), 'flash_error');
}
$this->olog ();
}

// This should probably be in the model, but not sure what to put in
there to make it work with paginate.

public function olog ()
{
if ($this->data == null) {

// Default everything unless the user passed in something in the form!

$conditions = array ();
$start_time = $this->Observation->find ('first', array
('fields' => array ('MIN(time)')));
$start_time = $start_time [0]['MIN(time)'];
$end_time = $this->Observation->find ('first', array
('fields' => array ('MAX(time)')));
$end_time = $end_time [0]['MAX(time)'];
$type = 'all';
$text = '';

if ($this->params ['named'] != null) {

// User is paging in this case!  There may or may not be information
in the form.

$conditions = array ();

if (isset ($this->params ['named']['type']) && ($this-
>params ['named']['type'] != 'all')) {
$type =  $this->params ['named']['type'];
$conditions [] = array ('type' => $this->params
['named']['type']);
}
if (isset ($this->params ['named']['start_time']) &&
($this->params ['named']['start_time'] != "")) {
$start_time = $this->params ['named']
['start_time'];
$conditions [] = array ('time >=' => $this->params
['named']['start_time']);
}
if (isset ($this->params ['named']['end_time']) &&
($this->params ['named']['end_time'] != "")) {
$end_time = $this->params ['named']['end_time'];
$conditions [] = array ('time <=' => $this->params
['named']['end_time']);
}
if ((isset ($this->params ['named']['text']) && $this-
>params ['named']['text'] != "")) {
$text =  $this->params ['named']['text'];
$conditions [] = array ("OR" => array ('object
LIKE ' => '%'.$this->params ['named']['text'].'%',
 
'description LIKE ' => '%'.$this->params ['named']['text'].'%'));
}
}
} else {

// Data is passed in from the form!

$conditions = array ();
if ($this->data ['Observation']['type'] != 'all') {
$conditions [] = array ('type' => $this->data
['Observation']['type']);
}
if ($this->data ['Observation']['start_time'] != "") {
$conditions [] = array ('time >=' => $this->data
['Observation']['start_time']);
}
if ($this->data ['Observation']['end_time'] != "") {
$conditions [] = array ('time <=' => $this->data
['Observation']['end_time']);
}
if ($this->data ['Observation']['text'] != "") {
$conditions [] = array ("OR" => array ('object LIKE '
=> '%'.$this->data ['Observation']['text'].'%',
   'description
LIKE ' => '%'.$this->data ['Observation']['text'].'%'));
  

Ajax Pagination

2012-01-25 Thread heohni
Hi,

is there anybody out there who has a ajax pagination working and
willing to talk about it?
I am looking for an solution to have a page with search results and
some filter options (checkboxes). Whenever a checkbox is checked I
would like to update the search results via ajax.

Thanks!!

-- 
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


Re: AJAX Pagination not working on sharedhost

2011-11-27 Thread leigh
Hi Petrisor,

That is great it's working, because it's a compatibility issue might
even be good to log a ticket or write a patch for it.. I might try and
do that.

kind regards,

Leigh

On Nov 27, 7:25 am, Petrisor Buga  wrote:
> Thx Leigh,
> After a few days starring into this problem i finally nailed it down
> after comparing different aspects between local server and online
> one.It looks like the problem was endeed in viewPath!
> using this 
> tut.http://bakery.cakephp.org/articles/rtconner/2007/06/29/advanced-pagin...
> and going with the first phrase form 
> herehttp://book.cakephp.org/2.0/en/core-libraries/helpers/js.html#ajax-pa...
>
> my original piece of code was:if($this->RequestHandler->isAjax()) {
>           $this->viewPath = 'elements';             $this->render('paging');  
>                 }
>
> and it was looking for the file: /home/independ/public_html/film/app/
> View/elements/paging.ctp , but using the default cakephp folder
> structure, my pagination .ctp file was laying in the /app/View/
> Elements/ folder (notice the big E on "Elements")
> i thought that cakephp would look for the file in this folder, like
> the controller looks automatically in the ../View/Movies for the
> MoviesController, but instead it was looking for the "elements" folder
> (and because "Elements" is different from "elements" on *nix sytems of
> course it would not work)
> the fix was to just modify $this->viewPath = 'Elements'; and for the
> future to specify THE EXACT location of the file!
> Thanks again,Petrisor
>
> On Nov 25, 9:31 am, leigh  wrote:
>
>
>
>
>
>
>
> > Hello Petrisor,
>
> > Check $this->viewPath and $this->view in your controller on the ajax
> > request to see if they're pointing to  a view file that exists.
>
> > Also are you using cake 2.0?
>
> > Kind regards,
>
> > Leigh
>
> > On Nov 24, 7:08 pm, Petrisor Buga  wrote:
>
> > > Hy, i've developed a project locally using MAMP on a mac, after i
> > > moved it online the links generated automatically by cakephp are not
> > > working anymore, more precisely i get "500 internal server error" on
> > > the ajax-get request and on the response i get:
>
> > > Error: The view for MoviesController::index() was not found.
> > > Error: Confirm you have created the file: /home/independ/public_html/
> > > film/app/View/elements/paging.ctp
>
> > > but the files are there and working, if i comment/remove the 
> > > $this->Js->writeBuffer(); line (and also remove the ajax functionality) 
> > > the
>
> > > links are working ok.
>
> > > i'm guessing it's something related to .htaccess files or file
> > > permissions somehow but i can't seem to figure them out!
> > > i tried on 3 different servers a vps, a sharedhost (this is the one
> > > that needs to work), a linux box and on all it acts the same, only on
> > > my mac works :|.
>
> > > i have also done another basic cakephp application starting from
> > > scratch that has ajax pagination and no success either :( works
> > > locally but not online.
>
> > > Thanks for taking time reading my problem!

-- 
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


Re: AJAX Pagination not working on sharedhost

2011-11-26 Thread Petrisor Buga
Thx Leigh,
After a few days starring into this problem i finally nailed it down
after comparing different aspects between local server and online
one.It looks like the problem was endeed in viewPath!
using this tut. 
http://bakery.cakephp.org/articles/rtconner/2007/06/29/advanced-pagination-1-2
and going with the first phrase form here
http://book.cakephp.org/2.0/en/core-libraries/helpers/js.html#ajax-pagination

my original piece of code was:if($this->RequestHandler->isAjax()) {  
          $this->viewPath = 'elements';             $this-
>render('paging');                  }
and it was looking for the file: /home/independ/public_html/film/app/
View/elements/paging.ctp , but using the default cakephp folder
structure, my pagination .ctp file was laying in the /app/View/
Elements/ folder (notice the big E on "Elements")
i thought that cakephp would look for the file in this folder, like
the controller looks automatically in the ../View/Movies for the
MoviesController, but instead it was looking for the "elements" folder
(and because "Elements" is different from "elements" on *nix sytems of
course it would not work)
the fix was to just modify $this->viewPath = 'Elements'; and for the
future to specify THE EXACT location of the file!
Thanks again,Petrisor

On Nov 25, 9:31 am, leigh  wrote:
> Hello Petrisor,
>
> Check $this->viewPath and $this->view in your controller on the ajax
> request to see if they're pointing to  a view file that exists.
>
> Also are you using cake 2.0?
>
> Kind regards,
>
> Leigh
>
> On Nov 24, 7:08 pm, Petrisor Buga  wrote:
>
>
>
>
>
>
>
> > Hy, i've developed a project locally using MAMP on a mac, after i
> > moved it online the links generated automatically by cakephp are not
> > working anymore, more precisely i get "500 internal server error" on
> > the ajax-get request and on the response i get:
>
> > Error: The view for MoviesController::index() was not found.
> > Error: Confirm you have created the file: /home/independ/public_html/
> > film/app/View/elements/paging.ctp
>
> > but the files are there and working, if i comment/remove the 
> > $this->Js->writeBuffer(); line (and also remove the ajax functionality) the
>
> > links are working ok.
>
> > i'm guessing it's something related to .htaccess files or file
> > permissions somehow but i can't seem to figure them out!
> > i tried on 3 different servers a vps, a sharedhost (this is the one
> > that needs to work), a linux box and on all it acts the same, only on
> > my mac works :|.
>
> > i have also done another basic cakephp application starting from
> > scratch that has ajax pagination and no success either :( works
> > locally but not online.
>
> > Thanks for taking time reading my problem!

-- 
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


Re: AJAX Pagination not working on sharedhost

2011-11-24 Thread leigh
Hello Petrisor,

Check $this->viewPath and $this->view in your controller on the ajax
request to see if they're pointing to  a view file that exists.

Also are you using cake 2.0?

Kind regards,

Leigh


On Nov 24, 7:08 pm, Petrisor Buga  wrote:
> Hy, i've developed a project locally using MAMP on a mac, after i
> moved it online the links generated automatically by cakephp are not
> working anymore, more precisely i get "500 internal server error" on
> the ajax-get request and on the response i get:
>
> Error: The view for MoviesController::index() was not found.
> Error: Confirm you have created the file: /home/independ/public_html/
> film/app/View/elements/paging.ctp
>
> but the files are there and working, if i comment/remove the 
> $this->Js->writeBuffer(); line (and also remove the ajax functionality) the
>
> links are working ok.
>
> i'm guessing it's something related to .htaccess files or file
> permissions somehow but i can't seem to figure them out!
> i tried on 3 different servers a vps, a sharedhost (this is the one
> that needs to work), a linux box and on all it acts the same, only on
> my mac works :|.
>
> i have also done another basic cakephp application starting from
> scratch that has ajax pagination and no success either :( works
> locally but not online.
>
> Thanks for taking time reading my problem!

-- 
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


AJAX Pagination not working on sharedhost

2011-11-24 Thread Petrisor Buga
Hy, i've developed a project locally using MAMP on a mac, after i
moved it online the links generated automatically by cakephp are not
working anymore, more precisely i get "500 internal server error" on
the ajax-get request and on the response i get:

Error: The view for MoviesController::index() was not found.
Error: Confirm you have created the file: /home/independ/public_html/
film/app/View/elements/paging.ctp

but the files are there and working, if i comment/remove the $this->Js-
>writeBuffer(); line (and also remove the ajax functionality) the
links are working ok.

i'm guessing it's something related to .htaccess files or file
permissions somehow but i can't seem to figure them out!
i tried on 3 different servers a vps, a sharedhost (this is the one
that needs to work), a linux box and on all it acts the same, only on
my mac works :|.

i have also done another basic cakephp application starting from
scratch that has ajax pagination and no success either :( works
locally but not online.

Thanks for taking time reading my problem!

-- 
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


Re: CakePHP Ajax Pagination working BUT on every other sort ? - What am I doing wrong?

2011-07-21 Thread OldWest


I solved this, BUT I don't like this solution. It's on the lines of what I 
originally suspected. The buffer was not calling the correct data, and so I 
added:

echo $this->Js->writeBuffer();

to the index.ctp and now it works as expected. So I have a copy of the 
buffer still in my default as well for other scripts...

Does not seem right, but at least it works now.

-- 
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


Re: Simple AJAX pagination not working

2011-05-26 Thread Philip Thompson
Those durn multiple js libraries. Go with Mootools and be done with it!! ;)

~Philip

On Thu, May 26, 2011 at 4:05 PM, l4yercake  wrote:

> Philip, thank you for the reply. I had called writeBuffer at the
> bottom of the view, so that was not the issue.
>
> I actually figured out what the problem was late last night after many
> hours spent trying different things. I will post here incase anyone
> else is faced with this problem.
>
> The issue was that I was loading in multiple javascripts, mainly
> prototype and jquery, which will conflict unless you make a call to
> noConflict (if I understand this correctly, I still need to read more
> about this).
>
> Even though I had read this section in the cakephp manual (http://
> book.cakephp.org/view/1643/Using-jQuery-with-other-libraries) I did
> not realize at the time that that was my problem.
>
>
> On May 26, 8:15 am, Philip Thompson  wrote:
> > You should also have a writeBuffer() call at the end of your home.ctp...
> >
> > Don't know if that will solve all your problems, but it's something. Hope
> > that helps.
> >
> > ~Philip
> >
> > http://lonestarlightandsound.com/
> >
> >
> >
> >
> >
> >
> >
> > On Wed, May 25, 2011 at 5:16 PM, l4yercake 
> wrote:
> > > Hello all,
> >
> > > I followed the directions in the Cake 1.3 manual to implement ajax
> > > pagination (http://book.cakephp.org/view/1600/Ajax-Pagination) and I
> > > also tried the method posted by Mark Story (Thanks!) on his blog
> > > (
> http://mark-story.com/posts/view/creating-simple-ajax-pagination-with-
> > > cakephp-1-3-and-mootools).
> >
> > > I know from the comments that these two methods have worked for users,
> > > but I can't seem to figure out what the issue is with my code. Here is
> > > a link to my code:http://bin.cakephp.org/view/441618115
> >
> > > This is what I am encountering: I have set a limit of 10 results.
> > > These results show up correctly, however when I click on the "next"
> > > link to show the rest of the results, the entire page goes empty.
> > > Without AJAX, I am taken to page 2 and the results show up. With AJAX
> > > implemented as shown in my code, the entire page just goes empty/
> > > white.
> >
> > > I have tried searching for this particular scenario and what might be
> > > affecting it but I could not find anything. I would appreciate any
> > > help.
> >
> > > Thank you!
> >
> > > --
> > > Our newest site for the community: CakePHP Video Tutorials
> > >http://tv.cakephp.org
> > > Check out the new CakePHP Questions sitehttp://ask.cakephp.organd 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
> > > athttp://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
>

-- 
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


Re: Simple AJAX pagination not working

2011-05-26 Thread l4yercake
Philip, thank you for the reply. I had called writeBuffer at the
bottom of the view, so that was not the issue.

I actually figured out what the problem was late last night after many
hours spent trying different things. I will post here incase anyone
else is faced with this problem.

The issue was that I was loading in multiple javascripts, mainly
prototype and jquery, which will conflict unless you make a call to
noConflict (if I understand this correctly, I still need to read more
about this).

Even though I had read this section in the cakephp manual (http://
book.cakephp.org/view/1643/Using-jQuery-with-other-libraries) I did
not realize at the time that that was my problem.


On May 26, 8:15 am, Philip Thompson  wrote:
> You should also have a writeBuffer() call at the end of your home.ctp...
>
> Don't know if that will solve all your problems, but it's something. Hope
> that helps.
>
> ~Philip
>
> http://lonestarlightandsound.com/
>
>
>
>
>
>
>
> On Wed, May 25, 2011 at 5:16 PM, l4yercake  wrote:
> > Hello all,
>
> > I followed the directions in the Cake 1.3 manual to implement ajax
> > pagination (http://book.cakephp.org/view/1600/Ajax-Pagination) and I
> > also tried the method posted by Mark Story (Thanks!) on his blog
> > (http://mark-story.com/posts/view/creating-simple-ajax-pagination-with-
> > cakephp-1-3-and-mootools).
>
> > I know from the comments that these two methods have worked for users,
> > but I can't seem to figure out what the issue is with my code. Here is
> > a link to my code:http://bin.cakephp.org/view/441618115
>
> > This is what I am encountering: I have set a limit of 10 results.
> > These results show up correctly, however when I click on the "next"
> > link to show the rest of the results, the entire page goes empty.
> > Without AJAX, I am taken to page 2 and the results show up. With AJAX
> > implemented as shown in my code, the entire page just goes empty/
> > white.
>
> > I have tried searching for this particular scenario and what might be
> > affecting it but I could not find anything. I would appreciate any
> > help.
>
> > Thank you!
>
> > --
> > Our newest site for the community: CakePHP Video Tutorials
> >http://tv.cakephp.org
> > Check out the new CakePHP Questions sitehttp://ask.cakephp.organd 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
> > athttp://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


Re: Simple AJAX pagination not working

2011-05-26 Thread Philip Thompson
You should also have a writeBuffer() call at the end of your home.ctp...

Don't know if that will solve all your problems, but it's something. Hope
that helps.

~Philip

http://lonestarlightandsound.com/

On Wed, May 25, 2011 at 5:16 PM, l4yercake  wrote:

> Hello all,
>
> I followed the directions in the Cake 1.3 manual to implement ajax
> pagination (http://book.cakephp.org/view/1600/Ajax-Pagination) and I
> also tried the method posted by Mark Story (Thanks!) on his blog
> (http://mark-story.com/posts/view/creating-simple-ajax-pagination-with-
> cakephp-1-3-and-mootools).
>
> I know from the comments that these two methods have worked for users,
> but I can't seem to figure out what the issue is with my code. Here is
> a link to my code: http://bin.cakephp.org/view/441618115
>
> This is what I am encountering: I have set a limit of 10 results.
> These results show up correctly, however when I click on the "next"
> link to show the rest of the results, the entire page goes empty.
> Without AJAX, I am taken to page 2 and the results show up. With AJAX
> implemented as shown in my code, the entire page just goes empty/
> white.
>
> I have tried searching for this particular scenario and what might be
> affecting it but I could not find anything. I would appreciate any
> help.
>
> Thank you!
>
> --
> 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


Simple AJAX pagination not working

2011-05-25 Thread l4yercake
Hello all,

I followed the directions in the Cake 1.3 manual to implement ajax
pagination (http://book.cakephp.org/view/1600/Ajax-Pagination) and I
also tried the method posted by Mark Story (Thanks!) on his blog
(http://mark-story.com/posts/view/creating-simple-ajax-pagination-with-
cakephp-1-3-and-mootools).

I know from the comments that these two methods have worked for users,
but I can't seem to figure out what the issue is with my code. Here is
a link to my code: http://bin.cakephp.org/view/441618115

This is what I am encountering: I have set a limit of 10 results.
These results show up correctly, however when I click on the "next"
link to show the rest of the results, the entire page goes empty.
Without AJAX, I am taken to page 2 and the results show up. With AJAX
implemented as shown in my code, the entire page just goes empty/
white.

I have tried searching for this particular scenario and what might be
affecting it but I could not find anything. I would appreciate any
help.

Thank you!

-- 
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


Re: ajax pagination cakephp 1.3 - day two cannot get this working.. any tips please

2011-05-14 Thread AD7six


On May 13, 6:32 pm, OldWest  wrote:
> Here is my source code snippets:http://bin.cakephp.org/view/327226811

When you tried the example exactly as shown in the book, did it work?

However, you don't need anything like IMO - js belongs in a js file,
not your php source. The best way to do ajax pagination (IMO) is do
_nothing_ relevant in your view/controller files.

and just add something like this to a js file:

addPaging(scope) {
  $('.paging a:not[href^=#]), th a[href*=/page:]',
scope).click(function(e) {
e.preventDefault();

$('.container').load($(this).attr('href'));
addPaging('.container');
  });
}

Or something of the likes.

AD

-- 
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


ajax pagination cakephp 1.3 - day two cannot get this working.. any tips please

2011-05-13 Thread OldWest
Here is my source code snippets: http://bin.cakephp.org/view/327226811

-- 
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


Re: Ajax Pagination in Cakephp

2011-03-27 Thread Jeremy Burns | Class Outfit
Here - I did a search for you on the Cake online guide and found this: 
http://book.cakephp.org/view/167/AJAX-Pagination. I guess you *could* have done 
that yourself.

Jeremy Burns
Class Outfit

jeremybu...@classoutfit.com
http://www.classoutfit.com

On 28 Mar 2011, at 05:12, Raajesh wrote:

> Hi Jeremy ,
> 
> Thanks for your valuable reply...
> 
> I want to implement Ajax pagination in version 1.2.
> 
> I am not able find the sample code for the same..
> 
> If you have any...Please let me know
> 
> Waiting for your reply...
> 
> Thanking you and regards,
> Raajesh
> 
> 
> 
> On Mar 28, 8:22 am, Jeremy Burns | Class Outfit
>  wrote:
>> http://book.cakephp.org/view/1600/Ajax-Pagination
>> 
>> Jeremy Burns
>> Class Outfit
>> 
>> jeremybu...@classoutfit.comhttp://www.classoutfit.com
>> 
>> On 28 Mar 2011, at 03:30, Raajesh wrote:> Hello,
>> 
>>> I want to apply the ajax pagination to my application. Please let me
>>> know how can we implement ajax pagination in cakephp.
>> 
>>> Your help will be appreciable..
>> 
>>> Thanking you and regards,
>>> Raajesh
>> 
>>> --
>>> Our newest site for the community: CakePHP Video 
>>> Tutorialshttp://tv.cakephp.org
>>> Check out the new CakePHP Questions sitehttp://ask.cakephp.organd 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 
>>> athttp://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

-- 
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


Re: Ajax Pagination in Cakephp

2011-03-27 Thread Raajesh
Hi Jeremy ,

Thanks for your valuable reply...

I want to implement Ajax pagination in version 1.2.

I am not able find the sample code for the same..

If you have any...Please let me know

Waiting for your reply...

Thanking you and regards,
Raajesh



On Mar 28, 8:22 am, Jeremy Burns | Class Outfit
 wrote:
> http://book.cakephp.org/view/1600/Ajax-Pagination
>
> Jeremy Burns
> Class Outfit
>
> jeremybu...@classoutfit.comhttp://www.classoutfit.com
>
> On 28 Mar 2011, at 03:30, Raajesh wrote:> Hello,
>
> > I want to apply the ajax pagination to my application. Please let me
> > know how can we implement ajax pagination in cakephp.
>
> > Your help will be appreciable..
>
> > Thanking you and regards,
> > Raajesh
>
> > --
> > Our newest site for the community: CakePHP Video 
> > Tutorialshttp://tv.cakephp.org
> > Check out the new CakePHP Questions sitehttp://ask.cakephp.organd 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 
> > athttp://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


Re: Ajax Pagination in Cakephp

2011-03-27 Thread Jeremy Burns | Class Outfit
http://book.cakephp.org/view/1600/Ajax-Pagination

Jeremy Burns
Class Outfit

jeremybu...@classoutfit.com
http://www.classoutfit.com

On 28 Mar 2011, at 03:30, Raajesh wrote:

> Hello,
> 
> I want to apply the ajax pagination to my application. Please let me
> know how can we implement ajax pagination in cakephp.
> 
> Your help will be appreciable..
> 
> Thanking you and regards,
> Raajesh
> 
> -- 
> 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


Ajax Pagination in Cakephp

2011-03-27 Thread Raajesh
Hello,

I want to apply the ajax pagination to my application. Please let me
know how can we implement ajax pagination in cakephp.

Your help will be appreciable..

Thanking you and regards,
Raajesh

-- 
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


Re: Pass post parameters in ajax pagination

2011-02-18 Thread Lastent
Meanwhile, I have done this:

$paginate_links = $paginator->numbers();

and I looked for the options in the scripts, using preg_match

preg_match('/{([^}|^{]*)}/', $paginate_links,$link_options);

and added my parameters  to the options(all are the same)

$paginate_links = str_replace($link_options[1], 
$link_options[1].',method:"post",parameters:$("myForm").serialize()', 
$paginate_links);

and I echo the $paginate_links

echo $paginate_links;

It works but maybe there is a better way to do it.

-- 
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


Pass post parameters in ajax pagination

2011-02-18 Thread Lastent
Hi, is there any way to pass some parameters by post, when using ajax
pagination, for example passing some filters

-- 
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


Re: Ajax Pagination - rearrange pages after item deleting

2010-09-03 Thread ohcibi
put something like
$("#itemlist").load("/items/index/page:$page #itemlist"); into your
delete function

On 2 Sep., 16:36, "Mariano C."  wrote:
> Suppose to have 3 page, I delete an object from page 2, so I would
> take the first element from page 3 and use it as last element of page
> 2, and so on...
>
> There's an article or tutorial to explain that?

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 cake-php@googlegroups.com
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?hl=en


Re: Ajax Pagination - rearrange pages after item deleting

2010-09-03 Thread cricket
On Fri, Sep 3, 2010 at 6:35 AM, Mariano C.  wrote:
> Yes, this is what I do actually.
> collection() function create my paginated list, after object removing
> I recall collection() function but this display first page of list,
> even if during deleting process I was at page 3.

Create the link in the view so that it will pass the page number (get
it from $this->params['page']) in the AJAX request. Then, adjust the
'page' option when calling paginate().

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 cake-php@googlegroups.com
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?hl=en


Re: Ajax Pagination - rearrange pages after item deleting

2010-09-03 Thread Mariano C.
Yes, this is what I do actually.
collection() function create my paginated list, after object removing
I recall collection() function but this display first page of list,
even if during deleting process I was at page 3.

On 3 Set, 06:22, Miloš Vučinić  wrote:
> I think you should refresh your view and then the pagiation should be
> set as it is supposed to be. I do not have much experience in Ajax so
> I can't really advise you better on how to make your own paginaton ..
>
> On Sep 2, 4:36 pm, "Mariano C."  wrote:
>
>
>
> > Suppose to have 3 page, I delete an object from page 2, so I would
> > take the first element from page 3 and use it as last element of page
> > 2, and so on...
>
> > There's an article or tutorial to explain that?

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 cake-php@googlegroups.com
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?hl=en


Re: Ajax Pagination - rearrange pages after item deleting

2010-09-02 Thread Miloš Vučinić
I think you should refresh your view and then the pagiation should be
set as it is supposed to be. I do not have much experience in Ajax so
I can't really advise you better on how to make your own paginaton ..

On Sep 2, 4:36 pm, "Mariano C."  wrote:
> Suppose to have 3 page, I delete an object from page 2, so I would
> take the first element from page 3 and use it as last element of page
> 2, and so on...
>
> There's an article or tutorial to explain that?

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 cake-php@googlegroups.com
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?hl=en


Ajax Pagination - rearrange pages after item deleting

2010-09-02 Thread Mariano C.
Suppose to have 3 page, I delete an object from page 2, so I would
take the first element from page 3 and use it as last element of page
2, and so on...

There's an article or tutorial to explain that?

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 cake-php@googlegroups.com
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?hl=en


Re: Ajax Pagination cakePHP 1.3 and jQuery // enable the RequestHandler component

2010-08-30 Thread roktok
In the end, the following solution works for me:

1. Modify jquery_engine.php as suggested by ecommy.com:

jquery has live event feature to acomplish that copy
cake/libs/view/helpers/jquery_engine.php to
app/views/helpers/jquery_engine.php
now open jquery_engine.php and on line 181 change the code from:
return sprintf('%s.bind("%s", %s);', $this->selection, $type,
$callback);
to
return sprintf('%s.live("%s", %s);', $this->selection, $type,
$callback); //ecommy.com modified code

2. Adding the writeBuffer at the bottom of the Ajax element:
echo $this->Js->writeBuffer();
as mentioned by many others,

and finally

3. Adding the component RequestHandler in the controller:
var $components = array('RequestHandler');

Without having enabled the RequestHandler, the steps above are
effectless.

Best,
Heiko




On 4 Aug., 20:39, bradmaxs  wrote:
> Thank you for your help.  I added the file to the helpers and changed
> the code and nothing changed:(
>
> Before I had the pagination outside of the element and now I have
> moved it inside the element and it seems to have made a change.
>
> Before it worked but only if I clicked on the numbers or like I
> explained if I clicked on next but only the first time.  Now it seems
> to work every other link.  So when I go to the page and click on the
> next it goes to the next page without a refresh.  If I click on next
> to go to the third page it does do that within the links but it
> refreshes the page.  So I am getting every other page by ajax.
>
> Here is the javascript at the bottom.  It still says bind even though
> I added the helper with the changed code.  Is this correct looking.
>
> 
> // $(document).ready(function () {$("#link-1109729578").bind("click",
> function (event) {$.ajax({dataType:"html", success:function (data,
> textStatus) {$("#comment").html(data);}, url:"\/thegarage\/view\/22\/
> page:2"});
> return false;});
> $("#link-922906323").bind("click", function (event)
> {$.ajax({dataType:"html", success:function (data, textStatus) {$
> ("#comment").html(data);}, url:"\/thegarage\/view\/22\/page:1"});
> return false;});
> $("#link-1486848737").bind("click", function (event)
> {$.ajax({dataType:"html", success:function (data, textStatus) {$
> ("#comment").html(data);}, url:"\/thegarage\/view\/22\/page:2"});
> return false;});});
> //]]>
> 
>
> Thank you so much for helping.
>
> Brad
>
> On Aug 3, 11:42 pm, "ecommy.com"  wrote:
>
> > This is a common problem - and is because jquery doesn't work similar
> > with prototype when it comes to executing ajax code inside a page that
> > was requested by ajax
>
> > jquery has live event feature to acomplish that copy
> > cake/libs/view/helpers/jquery_engine.php to
> > app/views/helpers/jquery_engine.php
>
> > now open jquery_engine.php and on line181change the code from:
>
> > return sprintf('%s.bind("%s", %s);', $this->selection, $type,
> > $callback);
>
> > to
>
> > return sprintf('%s.live("%s", %s);', $this->selection, $type,
> > $callback); //ecommy.com modified code
>
> > On Aug 4, 12:06 am, bradmaxs  wrote:
>
> > > I have set up pagination following the Mark Story article and it seems
> > > to work fine EXCEPT my next, previous and number links are not
> > > updating.
>
> > > If I click on next after the first page load, it goes to the next
> > > comment (cool), however the next link does not update to the third
> > > page and just stops working.  I can use the number links to each page
> > > and they work fine but they don't update either so I can never get
> > > back to page 1 without a refresh and you never know where you are.
>
> > > Here is lies the rub.  I am using one model for the main content of
> > > the page and contain for the comments.  Here is my controller code.
>
> > > // VIEW
> > >         function view($id = null) {
> > >                 if (!$id) {
> > >                         $this->Session->setFlash(sprintf(__('Invalid %s', 
> > > true), 'cshow'));
> > >                         $this->redirect(array('action' => 'index'));
> > >                 }
> > >                 $this->set('cshow', $this->Cshow->read(null, $id));
> > >                 $this->paginate = array(
> > >                         'contain' => array(
> > >                                 'User' => array(
> > >                                         'UserPreference.image'
> > >                                 ),
> > >                         ),
> > >                         'fields' => array(
> > >                                 'CshowComment.id', 
> > > 'CshowComment.user_id', 'CshowComment.comment',
> > > 'CshowComment.created', 'User.id', 'User.username'
> > >                         ),
> > >                         'conditions' => array(
> > >                                 'CshowComment.cshow_id' => $id
> > >                         ),
> > >                         'recursive' => 0,
> > >                         'limit' => 1,
> > >                         'order' =>  array(
> > >                                

Re: cakephp and Ajax pagination (mootools)

2010-08-23 Thread Philip Thompson
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

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 cake-php@googlegroups.com
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?hl=en


cakephp and Ajax pagination (mootools)

2010-08-21 Thread Mariano C.
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?

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 cake-php@googlegroups.com
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?hl=en


Re: jQuery & ajax pagination in 1.3

2010-08-17 Thread philthathril
I was having the same issue about the ajax pagination occurring every
other page (and I'm using MooTools). The key was that I *was* putting
the call to $js->writeBuffer() in my default.ctp view file in the
'content' div that got updated. However, this file was not seeing the
new content. So, I moved my writeBuffer() call from default.ctp to my
table.ctp (custom) element file and it worked! Yay! Recap...

default.ctp



...
writeBuffer(); ?> // Keep this at the bottom of the
page for the original-loaded content (if there is no table with
pagination)



table.ctp (custom element) - this file gets read with each ajax
request

...

writeBuffer(); ?> // Put this call in the view that
gets updated

Hope this helps some people out there because I really haven't seen
any clear explanation elsewhere.

Happy coding,
~Philip

On Dec 16 2009, 3:39 pm, mark_story  wrote:
> Yeah you need the writeBuffer() at the bottom of the view, or in 
> yourajaxlayout. Otherwise the event scripts don't get sent along.  I'll
> have to look into the jquery issue, I thought jquery did global eval()
> on all the script blocks in an html response, but seems I might have
> been wrong.
>
> -Mark
>
> On Dec 16, 5:27 am, Dave  wrote:
>
> > I have run into issues like this as well.  For some reason sometimes when
> > content is pulled in viaajaxI need to call $js->writeBuffer; at the bottom
> > of the view in the action which is called to get all of the javascript to
> > echo properly.
>
> > It kind of makes sense, if you have $js->writeBuffer at the bottom of your
> > layout, and your layout isn't refreshed, then you won't get the javascript
> > from the new view
>
> > I am not sure if this is how it is supposed to work, but that's just what
> > i've noticed
>
> > On Tue, Dec 15, 2009 at 2:21 PM, Joe Theory  wrote:
> > > I am having the same problem and can confirm that it happens
> > > specifically when using JQuery.   Using the Js Helper with Mootools
> > > works just fine.
>
> > > On Dec 14, 3:44 am, Scronkey  wrote:
> > > > I believe I know what's going on now but I'm not sure how to fix it.
>
> > > > On the first (successful)ajaxcall the next set of content is loaded,
> > > > including the paginator links, however the paginator links are not
> > > > successfully bound to a jQueryajaxcall, therefore the next click
> > > > results in a normal page request which then results in correctly bound
> > > > events.
>
> > > > Marks post mentions the use of 'evalScripts' => true to chain theajax
> > > > requests however this seems to have no effect with jQuery (his example
> > > > uses MooTools).
>
> > > > Is there a way I can ensure the events are rebound using jsHelper with
> > > > jQuery after theajaxcall?
>
> > > Check out the new CakePHP Questions sitehttp://cakeqs.organdhelp 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 cake-php@googlegroups.com
> > > To unsubscribe from this group, send email to
> > > cake-php+unsubscr...@googlegroups.com > >  om>For more options, visit this group at
> > >http://groups.google.com/group/cake-php?hl=en

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 cake-php@googlegroups.com
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?hl=en


Problem with ajax pagination and mootools

2010-08-13 Thread Mariano C.
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 reach page through:
http://my_web.com/items/admin/page:1 the link to page 2 is active, if
I click this link the second page will be opened in ajax style. OK!
Now, link for page 2 is disabled and link for page 1 is active, but,
if I click this link the page will be reloaded entirely as normal
call.

Viceversa happen if I call http://my_web.com/items/admin/page:2. Click
on page 1 will happen in AJAX, successivly clicking on page 2 will
happen with classic call.

Why?

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 cake-php@googlegroups.com
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?hl=en


Re: Ajax Pagination cakePHP 1.3 and jQuery

2010-08-04 Thread bradmaxs
Thank you for your help.  I added the file to the helpers and changed
the code and nothing changed:(

Before I had the pagination outside of the element and now I have
moved it inside the element and it seems to have made a change.

Before it worked but only if I clicked on the numbers or like I
explained if I clicked on next but only the first time.  Now it seems
to work every other link.  So when I go to the page and click on the
next it goes to the next page without a refresh.  If I click on next
to go to the third page it does do that within the links but it
refreshes the page.  So I am getting every other page by ajax.

Here is the javascript at the bottom.  It still says bind even though
I added the helper with the changed code.  Is this correct looking.


//


Thank you so much for helping.

Brad

On Aug 3, 11:42 pm, "ecommy.com"  wrote:
> This is a common problem - and is because jquery doesn't work similar
> with prototype when it comes to executing ajax code inside a page that
> was requested by ajax
>
> jquery has live event feature to acomplish that copy
> cake/libs/view/helpers/jquery_engine.php to
> app/views/helpers/jquery_engine.php
>
> now open jquery_engine.php and on line 181 change the code from:
>
> return sprintf('%s.bind("%s", %s);', $this->selection, $type,
> $callback);
>
> to
>
> return sprintf('%s.live("%s", %s);', $this->selection, $type,
> $callback); //ecommy.com modified code
>
> On Aug 4, 12:06 am, bradmaxs  wrote:
>
>
>
> > I have set up pagination following the Mark Story article and it seems
> > to work fine EXCEPT my next, previous and number links are not
> > updating.
>
> > If I click on next after the first page load, it goes to the next
> > comment (cool), however the next link does not update to the third
> > page and just stops working.  I can use the number links to each page
> > and they work fine but they don't update either so I can never get
> > back to page 1 without a refresh and you never know where you are.
>
> > Here is lies the rub.  I am using one model for the main content of
> > the page and contain for the comments.  Here is my controller code.
>
> > // VIEW
> >         function view($id = null) {
> >                 if (!$id) {
> >                         $this->Session->setFlash(sprintf(__('Invalid %s', 
> > true), 'cshow'));
> >                         $this->redirect(array('action' => 'index'));
> >                 }
> >                 $this->set('cshow', $this->Cshow->read(null, $id));
> >                 $this->paginate = array(
> >                         'contain' => array(
> >                                 'User' => array(
> >                                         'UserPreference.image'
> >                                 ),
> >                         ),
> >                         'fields' => array(
> >                                 'CshowComment.id', 'CshowComment.user_id', 
> > 'CshowComment.comment',
> > 'CshowComment.created', 'User.id', 'User.username'
> >                         ),
> >                         'conditions' => array(
> >                                 'CshowComment.cshow_id' => $id
> >                         ),
> >                         'recursive' => 0,
> >                         'limit' => 1,
> >                         'order' =>  array(
> >                                 'CshowComment.created' => 'desc'
> >                         )
> >                 );
> >                 $this->set('cshowComment', $this->paginate('CshowComment'));
> >                 if ($this->RequestHandler->isAjax()) {
> >                         $this->render('/elements/comments');
> >                         return;
> >                 }
> >                 $this->set('title_for_layout', 'eGarage.tv - View The 
> > Garage Show');
> >         }
>
> > In the view:
>
> > 
> > element('comments'); ?>
> > 
> > 
> > 
> > options(array('update' => '#comment')); ?>
> > Paginator->prev('<< '.__('previous', true), array(),
> > null, array('class'=>'disabled'));?> |  > $this->Paginator->numbers();?> |
>
> > Paginator->next(__('next', true).' >>', array(),
> > null, array('class' => 'disabled'));?>  > $this->Paginator->counter(array('format' => __('%page% of %pages%, %count% 
> > Comments',
>
> > true)));?>
> > 
>
> > and I have included the Js helper and the RequestHandler component in
> > my appCon

Re: Ajax Pagination cakePHP 1.3 and jQuery

2010-08-03 Thread ecommy.com
This is a common problem - and is because jquery doesn't work similar
with prototype when it comes to executing ajax code inside a page that
was requested by ajax

jquery has live event feature to acomplish that copy
cake/libs/view/helpers/jquery_engine.php to
app/views/helpers/jquery_engine.php

now open jquery_engine.php and on line 181 change the code from:

return sprintf('%s.bind("%s", %s);', $this->selection, $type,
$callback);

to

return sprintf('%s.live("%s", %s);', $this->selection, $type,
$callback); //ecommy.com modified code

On Aug 4, 12:06 am, bradmaxs  wrote:
> I have set up pagination following the Mark Story article and it seems
> to work fine EXCEPT my next, previous and number links are not
> updating.
>
> If I click on next after the first page load, it goes to the next
> comment (cool), however the next link does not update to the third
> page and just stops working.  I can use the number links to each page
> and they work fine but they don't update either so I can never get
> back to page 1 without a refresh and you never know where you are.
>
> Here is lies the rub.  I am using one model for the main content of
> the page and contain for the comments.  Here is my controller code.
>
> // VIEW
>         function view($id = null) {
>                 if (!$id) {
>                         $this->Session->setFlash(sprintf(__('Invalid %s', 
> true), 'cshow'));
>                         $this->redirect(array('action' => 'index'));
>                 }
>                 $this->set('cshow', $this->Cshow->read(null, $id));
>                 $this->paginate = array(
>                         'contain' => array(
>                                 'User' => array(
>                                         'UserPreference.image'
>                                 ),
>                         ),
>                         'fields' => array(
>                                 'CshowComment.id', 'CshowComment.user_id', 
> 'CshowComment.comment',
> 'CshowComment.created', 'User.id', 'User.username'
>                         ),
>                         'conditions' => array(
>                                 'CshowComment.cshow_id' => $id
>                         ),
>                         'recursive' => 0,
>                         'limit' => 1,
>                         'order' =>  array(
>                                 'CshowComment.created' => 'desc'
>                         )
>                 );
>                 $this->set('cshowComment', $this->paginate('CshowComment'));
>                 if ($this->RequestHandler->isAjax()) {
>                         $this->render('/elements/comments');
>                         return;
>                 }
>                 $this->set('title_for_layout', 'eGarage.tv - View The Garage 
> Show');
>         }
>
> In the view:
>
> 
> element('comments'); ?>
> 
> 
> 
> options(array('update' => '#comment')); ?>
> Paginator->prev('<< '.__('previous', true), array(),
> null, array('class'=>'disabled'));?> |  $this->Paginator->numbers();?> |
>
> Paginator->next(__('next', true).' >>', array(),
> null, array('class' => 'disabled'));?>  $this->Paginator->counter(array('format' => __('%page% of %pages%, %count% 
> Comments',
>
> true)));?>
> 
>
> and I have included the Js helper and the RequestHandler component in
> my appController as well as Js->writeBuffer();  ?>
> in my default layout right before the  tag.
>
> Not sure if this could be the problem but I am serving jQuery from a
> CDN and not from the webroot/js folder.
>
> I am using an element because if I don't the page duplicates the
> content that I am trying to update instead of loading via AJAX.  This
> may be the problem but I am stuck.
>
> I can post other code if this doesn't tell the whole story.
>
> Thanks in advance.

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 cake-php@googlegroups.com
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?hl=en


Ajax Pagination cakePHP 1.3 and jQuery

2010-08-03 Thread bradmaxs
I have set up pagination following the Mark Story article and it seems
to work fine EXCEPT my next, previous and number links are not
updating.

If I click on next after the first page load, it goes to the next
comment (cool), however the next link does not update to the third
page and just stops working.  I can use the number links to each page
and they work fine but they don't update either so I can never get
back to page 1 without a refresh and you never know where you are.

Here is lies the rub.  I am using one model for the main content of
the page and contain for the comments.  Here is my controller code.

// VIEW
function view($id = null) {
if (!$id) {
$this->Session->setFlash(sprintf(__('Invalid %s', 
true), 'cshow'));
$this->redirect(array('action' => 'index'));
}
$this->set('cshow', $this->Cshow->read(null, $id));
$this->paginate = array(
'contain' => array(
'User' => array(
'UserPreference.image'
),
),
'fields' => array(
'CshowComment.id', 'CshowComment.user_id', 
'CshowComment.comment',
'CshowComment.created', 'User.id', 'User.username'
),
'conditions' => array(
'CshowComment.cshow_id' => $id
),
'recursive' => 0,
'limit' => 1,
'order' =>  array(
'CshowComment.created' => 'desc'
)
);
$this->set('cshowComment', $this->paginate('CshowComment'));
if ($this->RequestHandler->isAjax()) {
$this->render('/elements/comments');
return;
}
$this->set('title_for_layout', 'eGarage.tv - View The Garage 
Show');
}

In the view:


element('comments'); ?>



options(array('update' => '#comment')); ?>
Paginator->prev('<< '.__('previous', true), array(),
null, array('class'=>'disabled'));?> | Paginator-
>numbers();?> |
Paginator->next(__('next', true).' >>', array(),
null, array('class' => 'disabled'));?> Paginator-
>counter(array('format' => __('%page% of %pages%, %count% Comments',
true)));?>


and I have included the Js helper and the RequestHandler component in
my appController as well as Js->writeBuffer();  ?>
in my default layout right before the  tag.

Not sure if this could be the problem but I am serving jQuery from a
CDN and not from the webroot/js folder.

I am using an element because if I don't the page duplicates the
content that I am trying to update instead of loading via AJAX.  This
may be the problem but I am stuck.

I can post other code if this doesn't tell the whole story.

Thanks in advance.

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 cake-php@googlegroups.com
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?hl=en


dynamic ajax pagination

2010-05-06 Thread priya dhakane
i had done pagination using ajax. But kept limit fixed. now i want to
keep limit dynamic.
i taken a select box,in that options for number of pages user want to
keep on a page.
like-10,20 etc. how to access this value for take in limit in paginate
method.
plz help me.

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 cake-php@googlegroups.com
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?hl=en


AJAX Pagination for "more commments" style functionality

2010-05-02 Thread Eric Anderson
Hi everyone,

I'm having a problem getting AJAX Pagination to work when adding
additional content to an unordered list.

So, what I want to set up is something along the lines of a Twitter
"more comments" AJAX loading system. When you click "more
comments" (the only pagination control element that will display) it
loads the next X many comments into the UL as LI elements.

So, here is my original code:

options(array('url'=>$this->passedArgs));
$paginator->options(array('update' => 'comment-list', 'indicator' =>
'spinner', 'position' => 'bottom'));
?>
flash(); ?>




On  by 



next('More comments', null, null, array('class'
=> 'disabled')); ?>

However, when you click "more comments" it ALSO loads all the controls
as well as the UL all over again. How can I get it to NOT display the
controls, as well as the UL when loading the next set of comments?

Thanks in advance!

Eric

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 cake-php@googlegroups.com
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?hl=en


Ajax Pagination

2010-03-01 Thread DAM
I implemented 
http://bakery.cakephp.org/articles/view/easy-ajax-pagination-using-jquery
ajax pagination using jquery.It's working but I wont to search
features I tried but not support ajax how to do it?

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 cake-php@googlegroups.com
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?hl=en


Re: jQuery & ajax pagination in 1.3

2010-01-03 Thread Aris
For some reason if you call the $js->writeBuffer() with the onDomReady
set to false it works.
give it a shot: $js->writeBuffer(array('onDomReady'=>false));
This worked for me
Aris

On Dec 17 2009, 3:42 pm, Joe Theory  wrote:
> Jquery is the only engine that seems to have issues Mark.  Thanks for
> this Js helper by the way.  So nice on so many levels.
>
> On Dec 16, 9:39 pm, mark_story  wrote:
>
> > Yeah you need the writeBuffer() at the bottom of the view, or in your
> > ajax layout. Otherwise the event scripts don't get sent along.  I'll
> > have to look into the jquery issue, I thought jquery did global eval()
> > on all the script blocks in an html response, but seems I might have
> > been wrong.
>
> > -Mark
>
> > On Dec 16, 5:27 am, Dave  wrote:
>
> > > I have run into issues like this as well.  For some reason sometimes when
> > > content is pulled in via ajax I need to call $js->writeBuffer; at the 
> > > bottom
> > > of the view in the action which is called to get all of the javascript to
> > > echo properly.
>
> > > It kind of makes sense, if you have $js->writeBuffer at the bottom of your
> > > layout, and your layout isn't refreshed, then you won't get the javascript
> > > from the new view
>
> > > I am not sure if this is how it is supposed to work, but that's just what
> > > i've noticed
>
> > > On Tue, Dec 15, 2009 at 2:21 PM, Joe Theory  wrote:
> > > > I am having the same problem and can confirm that it happens
> > > > specifically when using JQuery.   Using the Js Helper with Mootools
> > > > works just fine.
>
> > > > On Dec 14, 3:44 am, Scronkey  wrote:
> > > > > I believe I know what's going on now but I'm not sure how to fix it.
>
> > > > > On the first (successful) ajax call the next set of content is loaded,
> > > > > including the paginator links, however the paginator links are not
> > > > > successfully bound to a jQuery ajax call, therefore the next click
> > > > > results in a normal page request which then results in correctly bound
> > > > > events.
>
> > > > > Marks post mentions the use of 'evalScripts' => true to chain the ajax
> > > > > requests however this seems to have no effect with jQuery (his example
> > > > > uses MooTools).
>
> > > > > Is there a way I can ensure the events are rebound using jsHelper with
> > > > > jQuery after the ajax call?
>
> > > > Check out the new CakePHP Questions sitehttp://cakeqs.organdhelpothers
> > > > 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 cake-php@googlegroups.com
> > > > To unsubscribe from this group, send email to
> > > > cake-php+unsubscr...@googlegroups.com > > >  om>For more options, visit this group at
> > > >http://groups.google.com/group/cake-php?hl=en

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 cake-php@googlegroups.com
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?hl=en


Re: jQuery & ajax pagination in 1.3

2009-12-17 Thread Joe Theory
Jquery is the only engine that seems to have issues Mark.  Thanks for
this Js helper by the way.  So nice on so many levels.

On Dec 16, 9:39 pm, mark_story  wrote:
> Yeah you need the writeBuffer() at the bottom of the view, or in your
> ajax layout. Otherwise the event scripts don't get sent along.  I'll
> have to look into the jquery issue, I thought jquery did global eval()
> on all the script blocks in an html response, but seems I might have
> been wrong.
>
> -Mark
>
> On Dec 16, 5:27 am, Dave  wrote:
>
> > I have run into issues like this as well.  For some reason sometimes when
> > content is pulled in via ajax I need to call $js->writeBuffer; at the bottom
> > of the view in the action which is called to get all of the javascript to
> > echo properly.
>
> > It kind of makes sense, if you have $js->writeBuffer at the bottom of your
> > layout, and your layout isn't refreshed, then you won't get the javascript
> > from the new view
>
> > I am not sure if this is how it is supposed to work, but that's just what
> > i've noticed
>
> > On Tue, Dec 15, 2009 at 2:21 PM, Joe Theory  wrote:
> > > I am having the same problem and can confirm that it happens
> > > specifically when using JQuery.   Using the Js Helper with Mootools
> > > works just fine.
>
> > > On Dec 14, 3:44 am, Scronkey  wrote:
> > > > I believe I know what's going on now but I'm not sure how to fix it.
>
> > > > On the first (successful) ajax call the next set of content is loaded,
> > > > including the paginator links, however the paginator links are not
> > > > successfully bound to a jQuery ajax call, therefore the next click
> > > > results in a normal page request which then results in correctly bound
> > > > events.
>
> > > > Marks post mentions the use of 'evalScripts' => true to chain the ajax
> > > > requests however this seems to have no effect with jQuery (his example
> > > > uses MooTools).
>
> > > > Is there a way I can ensure the events are rebound using jsHelper with
> > > > jQuery after the ajax call?
>
> > > Check out the new CakePHP Questions sitehttp://cakeqs.organdhelp 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 cake-php@googlegroups.com
> > > To unsubscribe from this group, send email to
> > > cake-php+unsubscr...@googlegroups.com > >  om>For more options, visit this group at
> > >http://groups.google.com/group/cake-php?hl=en

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 cake-php@googlegroups.com
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?hl=en


Re: jQuery & ajax pagination in 1.3

2009-12-16 Thread mark_story
Yeah you need the writeBuffer() at the bottom of the view, or in your
ajax layout. Otherwise the event scripts don't get sent along.  I'll
have to look into the jquery issue, I thought jquery did global eval()
on all the script blocks in an html response, but seems I might have
been wrong.

-Mark

On Dec 16, 5:27 am, Dave  wrote:
> I have run into issues like this as well.  For some reason sometimes when
> content is pulled in via ajax I need to call $js->writeBuffer; at the bottom
> of the view in the action which is called to get all of the javascript to
> echo properly.
>
> It kind of makes sense, if you have $js->writeBuffer at the bottom of your
> layout, and your layout isn't refreshed, then you won't get the javascript
> from the new view
>
> I am not sure if this is how it is supposed to work, but that's just what
> i've noticed
>
>
>
> On Tue, Dec 15, 2009 at 2:21 PM, Joe Theory  wrote:
> > I am having the same problem and can confirm that it happens
> > specifically when using JQuery.   Using the Js Helper with Mootools
> > works just fine.
>
> > On Dec 14, 3:44 am, Scronkey  wrote:
> > > I believe I know what's going on now but I'm not sure how to fix it.
>
> > > On the first (successful) ajax call the next set of content is loaded,
> > > including the paginator links, however the paginator links are not
> > > successfully bound to a jQuery ajax call, therefore the next click
> > > results in a normal page request which then results in correctly bound
> > > events.
>
> > > Marks post mentions the use of 'evalScripts' => true to chain the ajax
> > > requests however this seems to have no effect with jQuery (his example
> > > uses MooTools).
>
> > > Is there a way I can ensure the events are rebound using jsHelper with
> > > jQuery after the ajax call?
>
> > Check out the new CakePHP Questions sitehttp://cakeqs.organd 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 cake-php@googlegroups.com
> > To unsubscribe from this group, send email to
> > cake-php+unsubscr...@googlegroups.com > om>For more options, visit this group at
> >http://groups.google.com/group/cake-php?hl=en

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 cake-php@googlegroups.com
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?hl=en


Re: jQuery & ajax pagination in 1.3

2009-12-16 Thread Dave
I have run into issues like this as well.  For some reason sometimes when
content is pulled in via ajax I need to call $js->writeBuffer; at the bottom
of the view in the action which is called to get all of the javascript to
echo properly.

It kind of makes sense, if you have $js->writeBuffer at the bottom of your
layout, and your layout isn't refreshed, then you won't get the javascript
from the new view

I am not sure if this is how it is supposed to work, but that's just what
i've noticed

On Tue, Dec 15, 2009 at 2:21 PM, Joe Theory  wrote:

> I am having the same problem and can confirm that it happens
> specifically when using JQuery.   Using the Js Helper with Mootools
> works just fine.
>
> On Dec 14, 3:44 am, Scronkey  wrote:
> > I believe I know what's going on now but I'm not sure how to fix it.
> >
> > On the first (successful) ajax call the next set of content is loaded,
> > including the paginator links, however the paginator links are not
> > successfully bound to a jQuery ajax call, therefore the next click
> > results in a normal page request which then results in correctly bound
> > events.
> >
> > Marks post mentions the use of 'evalScripts' => true to chain the ajax
> > requests however this seems to have no effect with jQuery (his example
> > uses MooTools).
> >
> > Is there a way I can ensure the events are rebound using jsHelper with
> > jQuery after the ajax call?
>
> 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 cake-php@googlegroups.com
> To unsubscribe from this group, send email to
> cake-php+unsubscr...@googlegroups.comFor
>  more options, visit this group at
> http://groups.google.com/group/cake-php?hl=en
>

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 cake-php@googlegroups.com
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?hl=en


Re: jQuery & ajax pagination in 1.3

2009-12-15 Thread Joe Theory
I am having the same problem and can confirm that it happens
specifically when using JQuery.   Using the Js Helper with Mootools
works just fine.

On Dec 14, 3:44 am, Scronkey  wrote:
> I believe I know what's going on now but I'm not sure how to fix it.
>
> On the first (successful) ajax call the next set of content is loaded,
> including the paginator links, however the paginator links are not
> successfully bound to a jQuery ajax call, therefore the next click
> results in a normal page request which then results in correctly bound
> events.
>
> Marks post mentions the use of 'evalScripts' => true to chain the ajax
> requests however this seems to have no effect with jQuery (his example
> uses MooTools).
>
> Is there a way I can ensure the events are rebound using jsHelper with
> jQuery after the ajax call?

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 cake-php@googlegroups.com
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?hl=en


Re: jQuery & ajax pagination in 1.3

2009-12-14 Thread Scronkey
I believe I know what's going on now but I'm not sure how to fix it.

On the first (successful) ajax call the next set of content is loaded,
including the paginator links, however the paginator links are not
successfully bound to a jQuery ajax call, therefore the next click
results in a normal page request which then results in correctly bound
events.

Marks post mentions the use of 'evalScripts' => true to chain the ajax
requests however this seems to have no effect with jQuery (his example
uses MooTools).

Is there a way I can ensure the events are rebound using jsHelper with
jQuery after the ajax call?

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 cake-php@googlegroups.com
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?hl=en


jQuery & ajax pagination in 1.3

2009-12-11 Thread Scronkey
Using Mark Story's guide for mootools, pagination and the new JS
helper (http://mark-story.com/posts/view/creating-simple-ajax-
pagination-with-cakephp-1-3-and-mootools) I have managed to get
pagination somewhat working using jQuery.

I say somewhat because only every second request uses ajax (clicking
sort or the pagination links). Every alternate request results in a
full request. This is confirmed through Firebug however it's quite
clear as the whole page refreshes.

When I place alerts in the before and success handlers (in the
$paginator->options array) they only fire after the full refresh,
which seems odd.

Has anyone seen this before or have any ideas on how I might diagnose
this further?

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 cake-php@googlegroups.com
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?hl=en


Ajax Pagination - Highlight Sort and Direction

2009-10-31 Thread enrique r grullon

Hi all,

I'm using Cakephp v1.25 and I'm trying to find a way to highlight the
sort column and direction when using ajax pagination.

On a second note, is it possible to collect sort columns and
directions so a user can combine them?

thanks in advance.

Enrique


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
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?hl=en
-~--~~~~--~~--~--~---



Ajax Pagination Helper

2009-07-22 Thread marco.rizze...@gmail.com

Hi
I try to use ajax pagination but I get always an error if I try
without ajax the pagination works.
My code is:

view.thtml:
link('test',
array( 'controller' => 'documents',
'action' => 'test'),
array( 'update' => 'dataRecipientsList' )
);
?>




test.thtml
options(array('update' => 'dataRecipientsList'));
?>


I get always this error :
element is null
if (element._prototypeEventID) return element._prototypeEventID[0];
\n
prototype.js (row 3936)

I don't understand where is error . Can someone help me ?
Many Thanks


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
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?hl=en
-~--~~~~--~~--~--~---



Need help on ajax pagination

2009-06-10 Thread Subhadeep

Hi,

   I have 2 separate listings of data in a page with search function
and pagination. I want the search terms to be hold when paginating.

  To implement this I had used the following snippet in my controller
named WorkoutController:

class WorkoutsController extends AppController {

var $name = 'Workouts';

var $uses = array
('Workout','WorkoutCategory','Myworkout','Workoutplanner','Workoutdetail');

var $helpers = array('Html', 'Form', 'Ajax', 'Javascript', 'Fck');

// called before every single action
function beforeFilter() {
  // some code here
}

function index() {
$this->layout = 'default';

//following is for myfavorite workouts
$this->data['Myworkout'] = $this->_proxyGather();

$this->paginate['Myworkout']['conditions']['Myworkout.userId'] =
$this->Session->read('userId');

if(!empty($this->data['Myworkout']['workoutName_myworkout'])) {
$this->data['Myworkout']['workoutName'] = 
$this->data['Myworkout']
['workoutName_myworkout'];

$this->paginate['Myworkout']['conditions']['Myworkout.workoutName
LIKE'] = '%'.$this->data['Myworkout']['workoutName'].'%';
}

$this->paginate['Myworkout']['conditions']['Myworkout.status'] =
'Y';

$this->paginate['Myworkout']['limit'] = 3;
$this->paginate['Myworkout']['order'] = array
('Myworkout.myworkoutId' => 'desc');

$myworkouts = $this->paginate('Myworkout');
$this->set('myworkouts', $myworkouts);

// following is for predefined workouts
$fitnessExperienceLevels = array('' => '-- All --', 'I' =>
'inXperianced', 'E' => 'Xperianced', 'X' => 'Xpert');
$this->set(compact('fitnessExperienceLevels'));

$workoutCategoryIds = $this->WorkoutCategory->find('list', array
('fields' => array('WorkoutCategory.categoryTitle')));
$this->set(compact('workoutCategoryIds'));

$this->data['Workout'] = $this->_proxyGather();

if(!empty($this->data['Workout']['fitnessExperienceLevel'])) {
$this->paginate['Workout']['conditions']
['Workout.fitnessExperienceLevel'] = $this->data['Workout']
['fitnessExperienceLevel'];
}

if(!empty($this->data['Workout']['workoutCategoryId'])) {
$this->paginate['Workout']['conditions']
['Workout.workoutCategoryId'] = $this->data['Workout']
['workoutCategoryId'];
}

if(!empty($this->data['Workout']['workoutName_preworkout'])) {
$this->data['Workout']['workoutName'] = 
$this->data['Workout']
['workoutName_preworkout'];

$this->paginate['Workout']['conditions']['Workout.workoutName
LIKE'] = '%'.$this->data['Workout']['workoutName'].'%';
}

$this->paginate['Workout']['conditions']['Workout.status'] = 
'Y';

$this->paginate['Workout']['limit'] = 3;
$this->paginate['Workout']['order'] = array('Workout.workoutId' 
=>
'desc');

$predefined_workouts = $this->paginate('Workout');
$this->set('predefined_workouts', $predefined_workouts);

if(isset($this->params['named']['perform'])) {
if(is_numeric($this->params['named']['perform'])) {
$this->Myworkout->unbindModel(array('belongsTo' 
=> array
('User')));
$perform_array = 
$this->Myworkout->findByMyworkoutid($this->params
['named']['perform']);
$this->set('perform_array', $perform_array);
}
}

$planned_workouts = $this->Workoutplanner->find('all',array
('conditions' => array('Myworkout.userId' => $this->Session->read
('userId'),'Workoutplanner.created LIKE' => date("Y-m-d").'%'),'order'
=> array('Workoutplanner.workoutplannerId')));
$this->set('planned_workouts', $planned_workouts);
}

function myworkouts() {
$this->layout = '';
Configure::write('debug', '0');
//following is for myfavorite workouts
$this->data['Myworkout'] = $this->_proxyGather();

$this->paginate['Myworkout']['conditions']['Myworkout.userId'] =
$this->Session->read('userId');

if(!empty($this->data['Myworkout']['workoutName_myworkout'])) {
$this->data['Myworkout']['workoutName'] = 
$this->data['Myworkout']
['workoutName_myworkout'];

$this->paginate['Myworkout']['conditions']['Myworkout.workoutName
LIKE'] = '%'.$this->data['Myworkout']['workoutName'].'%';
}

$this->paginate['Myworkout']['conditions']['Mywor

Re: MooTools Ajax Pagination

2009-03-08 Thread Websta*

I couldnt dig up that file anywhere so this isnt exact but it'll be
pretty much the same - maybe just var names different,

http://pastebin.com/d21cfcc86

I didnt test it this time either, so consider this a disclaimer if i
screwed up any of the var names.




On Mar 2, 3:09 pm, blake  wrote:
> Any chance someone still has this code elsewhere? Looks like it
> expired on pastebin.
>
> Thanks
>
> On Feb 9, 7:59 pm, "Websta*" 
> wrote:
>
> > Here is the code of a really basic mootools JS object that can pretty
> > much be dropped in for paging a standard cake index view
>
> >http://pastebin.com/d43137c
>
> > All you have to do is wrap your view code in a div and specify that id
> > as your pagingDivId
>
> > This is extremely basic and doesnt make allowance for request failure
> > events etc - just the basics.
>
> > HTH,
>
> > Paul.
>
> > On Feb 10, 11:45 am, "Arak Tai'Roth"  wrote:
>
> > > The project that I am currently working on is constrained by the fact
> > > that I have to use MooTools for a few things we are using. I also
> > > don't really want to use Prototype as the load times in certain cases
> > > aren't exactly friendly.
>
> > > So I was wondering if there is anywhere I can learn how to implement
> > > AJAX Pagination with MooTools, I know there is a tutorial in the
> > > bakery for JQuery, I was hoping for something similar using MooTools.
> > > Or if someone can give me some examples here.
>
> > > Any help is appreciated, thank you.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
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?hl=en
-~--~~~~--~~--~--~---



Re: MooTools Ajax Pagination

2009-03-02 Thread blake

Any chance someone still has this code elsewhere? Looks like it
expired on pastebin.

Thanks


On Feb 9, 7:59 pm, "Websta*" 
wrote:
> Here is the code of a really basic mootools JS object that can pretty
> much be dropped in for paging a standard cake index view
>
> http://pastebin.com/d43137c
>
> All you have to do is wrap your view code in a div and specify that id
> as your pagingDivId
>
> This is extremely basic and doesnt make allowance for request failure
> events etc - just the basics.
>
> HTH,
>
> Paul.
>
> On Feb 10, 11:45 am, "Arak Tai'Roth"  wrote:
>
> > The project that I am currently working on is constrained by the fact
> > that I have to use MooTools for a few things we are using. I also
> > don't really want to use Prototype as the load times in certain cases
> > aren't exactly friendly.
>
> > So I was wondering if there is anywhere I can learn how to implement
> > AJAX Pagination with MooTools, I know there is a tutorial in the
> > bakery for JQuery, I was hoping for something similar using MooTools.
> > Or if someone can give me some examples here.
>
> > Any help is appreciated, thank you.

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
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?hl=en
-~--~~~~--~~--~--~---



Re: MooTools Ajax Pagination

2009-02-10 Thread Arak Tai'Roth

Don't get me wrong, there's nothing wrong with it. I was just
personally hoping for something that was integrated more tightly into
CakePHP, that's all.

Also, I'm pretty new to using AJAX, and most definitely MooTools, so I
was hoping for more of a starting point.

On Feb 10, 10:07 am, grigri  wrote:
> What more do you want? That looks like a very neat starting point form
> ajax pagination with mootools (I use mootools as my js framework of
> choice; don't do a huge amount of ajax though).
>
> Why doesn't this seem like "the best option"? What's wrong with it?
>
> On Feb 10, 3:34 pm, "Arak Tai'Roth"  wrote:
>
> > Is there anything else out there? This is definitely an option, but it
> > doesn't seem like the best option to me.
>
> > On Feb 9, 6:59 pm, "Websta*" 
> > wrote:
>
> > > Here is the code of a really basic mootools JS object that can pretty
> > > much be dropped in for paging a standard cake index view
>
> > >http://pastebin.com/d43137c
>
> > > All you have to do is wrap your view code in a div and specify that id
> > > as your pagingDivId
>
> > > This is extremely basic and doesnt make allowance for request failure
> > > events etc - just the basics.
>
> > > HTH,
>
> > > Paul.
>
> > > On Feb 10, 11:45 am, "Arak Tai'Roth"  wrote:
>
> > > > The project that I am currently working on is constrained by the fact
> > > > that I have to use MooTools for a few things we are using. I also
> > > > don't really want to use Prototype as the load times in certain cases
> > > > aren't exactly friendly.
>
> > > > So I was wondering if there is anywhere I can learn how to implement
> > > > AJAX Pagination with MooTools, I know there is a tutorial in the
> > > > bakery for JQuery, I was hoping for something similar using MooTools.
> > > > Or if someone can give me some examples here.
>
> > > > Any help is appreciated, thank you.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
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?hl=en
-~--~~~~--~~--~--~---



Re: MooTools Ajax Pagination

2009-02-10 Thread grigri

What more do you want? That looks like a very neat starting point form
ajax pagination with mootools (I use mootools as my js framework of
choice; don't do a huge amount of ajax though).

Why doesn't this seem like "the best option"? What's wrong with it?

On Feb 10, 3:34 pm, "Arak Tai'Roth"  wrote:
> Is there anything else out there? This is definitely an option, but it
> doesn't seem like the best option to me.
>
> On Feb 9, 6:59 pm, "Websta*" 
> wrote:
>
> > Here is the code of a really basic mootools JS object that can pretty
> > much be dropped in for paging a standard cake index view
>
> >http://pastebin.com/d43137c
>
> > All you have to do is wrap your view code in a div and specify that id
> > as your pagingDivId
>
> > This is extremely basic and doesnt make allowance for request failure
> > events etc - just the basics.
>
> > HTH,
>
> > Paul.
>
> > On Feb 10, 11:45 am, "Arak Tai'Roth"  wrote:
>
> > > The project that I am currently working on is constrained by the fact
> > > that I have to use MooTools for a few things we are using. I also
> > > don't really want to use Prototype as the load times in certain cases
> > > aren't exactly friendly.
>
> > > So I was wondering if there is anywhere I can learn how to implement
> > > AJAX Pagination with MooTools, I know there is a tutorial in the
> > > bakery for JQuery, I was hoping for something similar using MooTools.
> > > Or if someone can give me some examples here.
>
> > > Any help is appreciated, thank you.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
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?hl=en
-~--~~~~--~~--~--~---



Re: MooTools Ajax Pagination

2009-02-10 Thread Arak Tai'Roth

Is there anything else out there? This is definitely an option, but it
doesn't seem like the best option to me.

On Feb 9, 6:59 pm, "Websta*" 
wrote:
> Here is the code of a really basic mootools JS object that can pretty
> much be dropped in for paging a standard cake index view
>
> http://pastebin.com/d43137c
>
> All you have to do is wrap your view code in a div and specify that id
> as your pagingDivId
>
> This is extremely basic and doesnt make allowance for request failure
> events etc - just the basics.
>
> HTH,
>
> Paul.
>
> On Feb 10, 11:45 am, "Arak Tai'Roth"  wrote:
>
> > The project that I am currently working on is constrained by the fact
> > that I have to use MooTools for a few things we are using. I also
> > don't really want to use Prototype as the load times in certain cases
> > aren't exactly friendly.
>
> > So I was wondering if there is anywhere I can learn how to implement
> > AJAX Pagination with MooTools, I know there is a tutorial in the
> > bakery for JQuery, I was hoping for something similar using MooTools.
> > Or if someone can give me some examples here.
>
> > Any help is appreciated, thank you.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
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?hl=en
-~--~~~~--~~--~--~---



Re: MooTools Ajax Pagination

2009-02-09 Thread Websta*

Here is the code of a really basic mootools JS object that can pretty
much be dropped in for paging a standard cake index view

http://pastebin.com/d43137c

All you have to do is wrap your view code in a div and specify that id
as your pagingDivId

This is extremely basic and doesnt make allowance for request failure
events etc - just the basics.

HTH,

Paul.



On Feb 10, 11:45 am, "Arak Tai'Roth"  wrote:
> The project that I am currently working on is constrained by the fact
> that I have to use MooTools for a few things we are using. I also
> don't really want to use Prototype as the load times in certain cases
> aren't exactly friendly.
>
> So I was wondering if there is anywhere I can learn how to implement
> AJAX Pagination with MooTools, I know there is a tutorial in the
> bakery for JQuery, I was hoping for something similar using MooTools.
> Or if someone can give me some examples here.
>
> Any help is appreciated, thank you.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
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?hl=en
-~--~~~~--~~--~--~---



MooTools Ajax Pagination

2009-02-09 Thread Arak Tai'Roth

The project that I am currently working on is constrained by the fact
that I have to use MooTools for a few things we are using. I also
don't really want to use Prototype as the load times in certain cases
aren't exactly friendly.

So I was wondering if there is anywhere I can learn how to implement
AJAX Pagination with MooTools, I know there is a tutorial in the
bakery for JQuery, I was hoping for something similar using MooTools.
Or if someone can give me some examples here.

Any help is appreciated, thank you.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
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?hl=en
-~--~~~~--~~--~--~---



Re: How can I hide the content on ajax request into CakePHP Ajax Pagination

2008-12-19 Thread bookme

I tried this also

$paginator->options(
array('update'=>'id_problem_index',
   'onCreate' => 'hideProcessing();',
   'onComplete' => 'showProcessing();',

   'url' => array('controller' => 'problems', 'action'
=> 'index', 'slug' => $business_entity_slug),
'indicator' => 'LoadingDiv'));

using hideProcessing I was trying to hide content and  using
showProcessing trying to show content.

But control is not going in these function.

Please help me for hiding content?

On Dec 19, 4:01 pm, bookme  wrote:
> Hi,
>
> I am trying CakePHP ajax pagination using prototype.js
>
> My code is below :
>
>      $paginator->options(
>             array('update'=>'CustomerPaging',
>                     'url'=>array('controller'=>'Customers',
> 'action'=>'display'),
>                     'indicator' => 'LoadingDiv'));
> ?>
> 
>     image('ajax-loader.gif'); ?>
> 
>
> 
>     renderElement('customers/paging'); ?>
> 
>
> I want to hide the content of div id "CustomerPaging" when 'ajax-
> loader.gif' image is being displayed on ajax request.
>
> I think that it can be done using Ajax.Responders.register, but where
> should this java script function be called ?
>
> Ajax.Responders.register({
>   onCreate: showProcessing,
>   onComplete: hideProcessing
>
> });
>
> Is there any way that I can hide the content of  div Id
> "CustomerPaging" when the "loader" image is displaying using
> Prototype.js in CakePHP ajax pagination.
>
> Please help me
> Thanks
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
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?hl=en
-~--~~~~--~~--~--~---



How can I hide the content on ajax request into CakePHP Ajax Pagination

2008-12-19 Thread bookme

Hi,

I am trying CakePHP ajax pagination using prototype.js

My code is below :

options(
array('update'=>'CustomerPaging',
'url'=>array('controller'=>'Customers',
'action'=>'display'),
'indicator' => 'LoadingDiv'));
?>

image('ajax-loader.gif'); ?>



renderElement('customers/paging'); ?>


I want to hide the content of div id "CustomerPaging" when 'ajax-
loader.gif' image is being displayed on ajax request.

I think that it can be done using Ajax.Responders.register, but where
should this java script function be called ?

Ajax.Responders.register({
  onCreate: showProcessing,
  onComplete: hideProcessing
});


Is there any way that I can hide the content of  div Id
"CustomerPaging" when the "loader" image is displaying using
Prototype.js in CakePHP ajax pagination.

Please help me
Thanks

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
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?hl=en
-~--~~~~--~~--~--~---



Re: Cake php ajax pagination

2008-07-14 Thread Chris Hartjes

On Mon, Jul 14, 2008 at 3:16 PM, puneetratan <[EMAIL PROTECTED]> wrote:
>
> Hello Group,
> I am doing ajax pagination in cake php. but i also have some search
> criterias which  i need on second or third pages also, so that
> condition retains.
>
> right now i am using cake session (storing the condition into session)
> is there any other way to store condition, so that we can get on
> second page.
> Plz let me know

http://book.cakephp.org/view/164/pagination

-- 
Chris Hartjes
Motto for 2008: "Moving from herding elephants to handling snakes..."
@TheKeyBoard: http://www.littlehart.net/atthekeyboard

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
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
-~--~~~~--~~--~--~---



Cake php ajax pagination

2008-07-14 Thread puneetratan

Hello Group,
I am doing ajax pagination in cake php. but i also have some search
criterias which  i need on second or third pages also, so that
condition retains.

right now i am using cake session (storing the condition into session)
is there any other way to store condition, so that we can get on
second page.
Plz let me know


Thanks
Puneet

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
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
-~--~~~~--~~--~--~---



ajax pagination + tabs = mystical effects

2008-06-12 Thread dr. Hannibal Lecter

Hi all,

I've run into a problem which I can't figure out, and it involves AJAX
pagination and some other AJAX links.

Here is an example (bear with me):

http://dsi.vozibrale.com/articles/view/cakephp-and-the-infamous-remember-me-cookie#comments

Now, if you click on the "Add" link, it should open a form for a new
comment. Now click back to "View", and try to change the page twice.
Works for the first click, but not for the second.

What is going on here? It seems like the click event is never caught
(which is impossible). I get no PHP or JavaScript error. All the code
is in place. And if you click on the page numbers *before* switching
to "add new comment" form and back, they work just fine. As if
Prototype stops working suddenly.

Has anyone run into this issue before? Am I missing something simple?

The code is available here: 
http://dsi.vozibrale.com/downloads/view/neutrino-0.1-alpha
if you care enough to take a look. If I don't figure this out somehow
I'll probably have to drop the pagination of comments, which would
suck. :-/

If anyone has a clue for me, I'd appreciate it greatly.

Cheers!
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
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
-~--~~~~--~~--~--~---



Ajax Pagination 'Freaks' in IE, any ideas?

2008-06-06 Thread Smelly_Eddie

I use the pagination component in 1.1 written by Andy Dawson.

Everything works great in FF, but running under IE, the page gets
thrown into a never ending update cycle, and keeps reverting to
defaults.

In other words, after you change the sort order, or results per page,
it begins to reload every second.  If you are quick enough you can get
it to make the changes you select, but it is incredible annoying, and
can not be made public like this.

http://thegreenlifelist.org/ingredients


Any previous experience or wild suggestions would be a great help.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
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
-~--~~~~--~~--~--~---



Am I using ajax pagination correctly?

2008-02-01 Thread Mac65

I'm using the Pagination helper in 1.2, and I have it working using
AJAX, but I'm not sure I'm using it correctly.

This is my scenario:

I have a view named users with an index page that displays a paginated
view of all users.

The index method in my users controller originally contained this
code:

$this->User->recursive = 0;
$this->set('users', $this->paginate());

and my index.ctp file uses the paginator to display the list of users.

My default.ctp layout is a typical layout page with a section in the
middle that looks like this:


   



With this setup, whenever I use the paginator to view other pages, the
entire index.ctp is displayed inside the default.ctp layout within the
content section.

The only way I was able to get around this was to change my index
method in the users controller to this:

$this->User->recursive = 0;
if ($this->action == "index" && isset($this->params['named']['page']))
   $this->layout = "";
$this->set('users', $this->paginate());

Forcing it to not use the default.ctp layout if the ajax "page"
parameter was passed in.

It seems like the paginator should know not to use the overall page
layout, as I am just try to render the content section.

I would be interesting in hearing any other ideas on how to make this
work.

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
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
-~--~~~~--~~--~--~---



  1   2   >