Hi,
this is my controller:
public function search($searchSingleId = false, $singleId = null) {
if ($this->request->is('ajax')) {
$this->layout = false;
}
..snip
if ($this->request->is('ajax')) {
$this->layout = false;
}
..snip
$this->set('results', $results);
if ($this->request->is('ajax')) {
$this->render('/Elements/paginate-results');
return;
}
}
if ($this->request->is('ajax')) {
$this->render('/Elements/paginate-results');
return;
}
}
and this the search.ctp
<?=$this->element('detailsearch'); // this is a search box which should stay on the page and should not reload
<?=$this->element('paginate-results'); ?> // here is the search results content
<?=$this->element('paginate-results'); ?> // here is the search results content
and this is paginate-results.ctp
<?php $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('hide', array('buffer' => false)),
)); ?>
<div id="searchResults">
'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)),
)); ?>
<div id="searchResults">
... snip
<?php $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('hide', array('buffer' => false)),
)); ?>
<div id="searchResults">
'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)),
)); ?>
<div id="searchResults">
...snip
</div>
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: <li><a href="/objekts/search/page:1/cat:1" id="link-588683523">1</a>
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+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php
No comments:
Post a Comment