开发者

jQuery ajax pagination

开发者_如何学JAVA

I'd like to setup jquery pagination via ajax with the Pagination plugin. Unfortunately, I can't get the example to display more than one result (even after I change the items_per_page setting). How can I get this to work? Can downloaded from github.


It looks like the items_per_page setting is only used internally and doesn't affect how it displays the results

items_per_page The number of items per page. The maximum number of pages is calculated by dividing the number of items by items_per_page (rounded up, minimum 1). Please note: This value is only for calculating the number of pages. The actual selection of the items correlating to the current page and number of items must be done by your code in your callback function! Default: 10

You will need to update this function if you want to increase the items per page using some kind of skip and take

function pageselectCallback(page_index, jq){
     var new_content = $('#hiddenresult div.result:eq('+page_index+')').clone();
     $('#Searchresult').empty().append(new_content);
     return false;
}

All this is doing is copying the element at the current page index i.e. 1-3.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜