我試着去實現此處(https://github.com/jney/jquery.pageless)發現了無盡的分頁jQuery插件到我笨項目。笨/ jQuery的 - 分頁 - 無盡分頁
jQuery代碼我輸入相同什麼演示頁
$('#results').pageless({ totalPages: 10
, url: '/theurl/index'
, loaderMsg: 'Loading more results'
});
和代碼,我在我的笨控制器如下
$config['base_url'] = base_url() . 'theurl/index';
$config['total_rows'] = $this->model->record_count();
$config['per_page'] = 20;
$config['uri_segment'] = 3;
// Init the config
$this->pagination->initialize($config);
// Create pagination
$page = ($this->uri->segment(3)) ? $this->uri->segment(3) : 0;
$data['results'] = $this->onyafeet->fetch_results($config['per_page'], $page);
$data['links'] = $this->pagination->create_links();
// Load the view and pass through all the data
$this->load->view('theurl/index', $data);
當我運行的代碼上,併到達頁面的底部,它可以工作,但它也會將輸入頁面加載到它爲結果創建的新div中。
任何幫助將不勝感激。
乾杯
你的意思是「整個頁面吧?那麼,如果是「整個」頁面,那麼您正在加載的視圖究竟是什麼,這是您將嵌套在成功的分頁調用上的內容。 –
喂大衛,感謝您的答覆......這非常有意義......會是什麼來解決這個問題的最好方法是什麼? – BigJobbies
創建一個視圖,其中只包含需要在分頁結果中顯示的數據,然後調用該數據。 –