2013-06-21 26 views
0

我遇到了這個問題,默認情況下paginator的前一個按鈕被禁用(具有禁用類),即使我處於第二或第三或任何頁面。如果我刪除了'id => prevPage'和'id => nextPage',那麼它工作正常,但我必須用它來做出另一個Ajax請求。Paginator prev不能使用Ajax查看

我在我的AJAX視圖中使用這個..

echo $this->Paginator->prev('< ' . __('Zur'), array('id' => 'prevPage'), null, array('class' => 'prev disabled')); 
echo $this->Paginator->next(__('Vor') . ' >', array('id' => 'nextPage'), null, array('class' => 'next disabled')); 

,而在我的控制,我有;

if($this->RequestHandler->isAjax()) { 
$this->autoRender = false; 
$this->set('products',$this->paginate('Product')); 
$this->set('page',$page); 
$this->render('ajaxView'); 
} 

我做了一點谷歌搜索,這表明它可能是bug ..是嗎?我如何解決?

回答

0

我無法找到錯誤,但我通過其他方式修復了錯誤。我在控制器分頁時使用了'偏移量',然後在其中引入了錯誤,但是通過在ajax調用上請求'.../page:3?q ='的方法,解決了問題。感謝@hereshem的快速修復。