Re: Pagination and JQuery: Passing parameters with JQuery to controller

2011-09-03 Thread Tomfox Wiranata
i made it work! i used a variable checking what div whas clicked and a
dummy model.thanks for all your help :)

On 31 Aug., 10:04, Tomfox Wiranata tomfox.wiran...@gmail.com wrote:
 hi paul,

 yes, with the links href i am already passing the page number

 controller/action/page:x

 to my actions isAjax() function. but i need an additional parameter,
 so my controller knows what element to render within the isAjax():
 if ($this-RequestHandler-isAjax())
 {

 when user clicks on div pagination_follow
                 $this-render('/elements/users/following');
                 return;

 when user clicks on div pagination_created
                 $this-render('/elements/users/created');
                 return;
                 }

 i just cant get jquery to pass that additional variable

 On Aug 31, 9:56 am, WebbedIT p...@webbedit.co.uk wrote:







  The parameter(s) should already be in the link's href attribute, if
  not you're not using pagination to display your column sort and paging
  links?

  Have you read this (not done so myself, but should give you some
  pointers):http://bakery.cakephp.org/articles/daphonz/2008/05/03/easy-ajax-pagin...

  HTH, Paul

  On Aug 30, 8:59 am, Tomfox Wiranata tomfox.wiran...@gmail.com wrote:

   thx, again ;)

   stupid question. with ajax request you mean doing so within jquery,
   correct? how would i do it here?

   $('#pagination_created a').live('click', function() {
                       var url = $(this).attr(href);   !
   I'm having a feeling that i need to add the parameter to this line
                       $('#following_popup').load(url);
                       return false;
                   });

   thanks a lot :)

   On Aug 30, 9:28 am, WebbedIT p...@webbedit.co.uk wrote:

There is nothing special about achieving this as CakePHP takes the
passed or named variables the same way as any other time.  Simply send
an ajax request to:

/controller/action/variableValue

or

/controller/action/variableName:variableValue

If you're still struggling to access the variable in your action add
echo debug($this-params); to see where the variable ends up.

HTH, Paul.

On Aug 29, 3:41 pm, Tomfox Wiranata tomfox.wiran...@gmail.com wrote:

 hi huoxito,

 thx for your post. no i didnt get there cause my way worked too.
 if you/someone know/knows how to pass a variable with jquery to the
 isAjax() i'd rather stay with my solution, otherwise i might give it a
 try..

 On Aug 29, 2:22 pm, huoxito huox...@gmail.com wrote:

  Have u tried to do it use cake built in ajax pagination?

 http://book.cakephp.org/view/1600/Ajax-Pagination-Hidequotedtext -

- Show quoted text -- Hide quoted text -

  - Show quoted text -

-- 
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: Pagination and JQuery: Passing parameters with JQuery to controller

2011-08-31 Thread WebbedIT
The parameter(s) should already be in the link's href attribute, if
not you're not using pagination to display your column sort and paging
links?

Have you read this (not done so myself, but should give you some
pointers):
http://bakery.cakephp.org/articles/daphonz/2008/05/03/easy-ajax-pagination-using-jquery

HTH, Paul

On Aug 30, 8:59 am, Tomfox Wiranata tomfox.wiran...@gmail.com wrote:
 thx, again ;)

 stupid question. with ajax request you mean doing so within jquery,
 correct? how would i do it here?

 $('#pagination_created a').live('click', function() {
                     var url = $(this).attr(href);   !
 I'm having a feeling that i need to add the parameter to this line
                     $('#following_popup').load(url);
                     return false;
                 });

 thanks a lot :)

 On Aug 30, 9:28 am, WebbedIT p...@webbedit.co.uk wrote:







  There is nothing special about achieving this as CakePHP takes the
  passed or named variables the same way as any other time.  Simply send
  an ajax request to:

  /controller/action/variableValue

  or

  /controller/action/variableName:variableValue

  If you're still struggling to access the variable in your action add
  echo debug($this-params); to see where the variable ends up.

  HTH, Paul.

  On Aug 29, 3:41 pm, Tomfox Wiranata tomfox.wiran...@gmail.com wrote:

   hi huoxito,

   thx for your post. no i didnt get there cause my way worked too.
   if you/someone know/knows how to pass a variable with jquery to the
   isAjax() i'd rather stay with my solution, otherwise i might give it a
   try..

   On Aug 29, 2:22 pm, huoxito huox...@gmail.com wrote:

Have u tried to do it use cake built in ajax pagination?

   http://book.cakephp.org/view/1600/Ajax-Pagination-Hide quoted text -

  - Show quoted text -

-- 
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: Pagination and JQuery: Passing parameters with JQuery to controller

2011-08-31 Thread Tomfox Wiranata
hi paul,

yes, with the links href i am already passing the page number

controller/action/page:x

to my actions isAjax() function. but i need an additional parameter,
so my controller knows what element to render within the isAjax():
if ($this-RequestHandler-isAjax())
{


when user clicks on div pagination_follow
$this-render('/elements/users/following');
return;


when user clicks on div pagination_created
$this-render('/elements/users/created');
return;
}



i just cant get jquery to pass that additional variable





On Aug 31, 9:56 am, WebbedIT p...@webbedit.co.uk wrote:
 The parameter(s) should already be in the link's href attribute, if
 not you're not using pagination to display your column sort and paging
 links?

 Have you read this (not done so myself, but should give you some
 pointers):http://bakery.cakephp.org/articles/daphonz/2008/05/03/easy-ajax-pagin...

 HTH, Paul

 On Aug 30, 8:59 am, Tomfox Wiranata tomfox.wiran...@gmail.com wrote:



  thx, again ;)

  stupid question. with ajax request you mean doing so within jquery,
  correct? how would i do it here?

  $('#pagination_created a').live('click', function() {
                      var url = $(this).attr(href);   !
  I'm having a feeling that i need to add the parameter to this line
                      $('#following_popup').load(url);
                      return false;
                  });

  thanks a lot :)

  On Aug 30, 9:28 am, WebbedIT p...@webbedit.co.uk wrote:

   There is nothing special about achieving this as CakePHP takes the
   passed or named variables the same way as any other time.  Simply send
   an ajax request to:

   /controller/action/variableValue

   or

   /controller/action/variableName:variableValue

   If you're still struggling to access the variable in your action add
   echo debug($this-params); to see where the variable ends up.

   HTH, Paul.

   On Aug 29, 3:41 pm, Tomfox Wiranata tomfox.wiran...@gmail.com wrote:

hi huoxito,

thx for your post. no i didnt get there cause my way worked too.
if you/someone know/knows how to pass a variable with jquery to the
isAjax() i'd rather stay with my solution, otherwise i might give it a
try..

On Aug 29, 2:22 pm, huoxito huox...@gmail.com wrote:

 Have u tried to do it use cake built in ajax pagination?

http://book.cakephp.org/view/1600/Ajax-Pagination-Hidequoted text -

   - Show quoted text -- Hide quoted text -

 - Show quoted text -

-- 
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: Pagination and JQuery: Passing parameters with JQuery to controller

2011-08-30 Thread WebbedIT
There is nothing special about achieving this as CakePHP takes the
passed or named variables the same way as any other time.  Simply send
an ajax request to:

/controller/action/variableValue

or

/controller/action/variableName:variableValue

If you're still struggling to access the variable in your action add
echo debug($this-params); to see where the variable ends up.

HTH, Paul.

On Aug 29, 3:41 pm, Tomfox Wiranata tomfox.wiran...@gmail.com wrote:
 hi huoxito,

 thx for your post. no i didnt get there cause my way worked too.
 if you/someone know/knows how to pass a variable with jquery to the
 isAjax() i'd rather stay with my solution, otherwise i might give it a
 try..

 On Aug 29, 2:22 pm, huoxito huox...@gmail.com wrote:







  Have u tried to do it use cake built in ajax pagination?

 http://book.cakephp.org/view/1600/Ajax-Pagination

-- 
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: Pagination and JQuery: Passing parameters with JQuery to controller

2011-08-30 Thread Tomfox Wiranata
thx, again ;)

stupid question. with ajax request you mean doing so within jquery,
correct? how would i do it here?

$('#pagination_created a').live('click', function() {
var url = $(this).attr(href);   !
I'm having a feeling that i need to add the parameter to this line
$('#following_popup').load(url);
return false;
});



thanks a lot :)


On Aug 30, 9:28 am, WebbedIT p...@webbedit.co.uk wrote:
 There is nothing special about achieving this as CakePHP takes the
 passed or named variables the same way as any other time.  Simply send
 an ajax request to:

 /controller/action/variableValue

 or

 /controller/action/variableName:variableValue

 If you're still struggling to access the variable in your action add
 echo debug($this-params); to see where the variable ends up.

 HTH, Paul.

 On Aug 29, 3:41 pm, Tomfox Wiranata tomfox.wiran...@gmail.com wrote:



  hi huoxito,

  thx for your post. no i didnt get there cause my way worked too.
  if you/someone know/knows how to pass a variable with jquery to the
  isAjax() i'd rather stay with my solution, otherwise i might give it a
  try..

  On Aug 29, 2:22 pm, huoxito huox...@gmail.com wrote:

   Have u tried to do it use cake built in ajax pagination?

  http://book.cakephp.org/view/1600/Ajax-Pagination- Hide quoted text -

 - Show quoted text -

-- 
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: Pagination and JQuery: Passing parameters with JQuery to controller

2011-08-29 Thread huoxito
Have u tried to do it use cake built in ajax pagination?

http://book.cakephp.org/view/1600/Ajax-Pagination

-- 
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: Pagination and JQuery: Passing parameters with JQuery to controller

2011-08-29 Thread Tomfox Wiranata
hi huoxito,

thx for your post. no i didnt get there cause my way worked too.
if you/someone know/knows how to pass a variable with jquery to the
isAjax() i'd rather stay with my solution, otherwise i might give it a
try..



On Aug 29, 2:22 pm, huoxito huox...@gmail.com wrote:
 Have u tried to do it use cake built in ajax pagination?

 http://book.cakephp.org/view/1600/Ajax-Pagination

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


Pagination and JQuery: Passing parameters with JQuery to controller

2011-08-28 Thread Tomfox Wiranata
Hi,

this is hard to explain quick but i'll try :)

I have one view profile in my controller. in that profile.ctp i have
two elements. following and created. in each element i want
paging.

i got it work for the element following but i need also for
created. The Catch:

i need to use one paginate in my profile function for two elements. so
my approach is, depending on what paginator you click, following or
created, a specific variable is passed to the controllers

$this-RequestHandler-isAjax()

function, which is rendering the specific element (following or
created). And thats what i got so far:


controller:
===

public $paginate = array(
'Link' =
  some code
)),

'Created' =
   some code
)
);


function profile()
{


$following = $this-paginate('Link', $conditions);
 $created = $this-paginate('Created');

$this-set('following', $following);
$this-set('created', $created);


if ($this-RequestHandler-isAjax()) {
$this-render('/elements/users/following');
return;
}

}


view profile


$('#pagination_follow a').live('click', function() {
var url = $(this).attr(href);
$('#following_popup').load(url);
return false;
});

$('#pagination_created a').live('click', function() {
var url = $(this).attr(href);
$('#following_popup').load(url);
return false;
});



so basically i would code two divs pagination_created in element
created and
pagination_follow in the element following. depending on what div
a user clicks i want to pass a value to the isAjax() function in
controller, like this


if ($this-RequestHandler-isAjax())
{

when user clicks on div pagination_follow
$this-render('/elements/users/following');
return;

when user clicks on div pagination_created
$this-render('/elements/users/created');
return;
}

so pagination knows what element to renderis that possible and how
can i pass a variable to the controller?

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