提交 | 用户 | 时间
|
58d006
|
1 |
function ttlist(page,pagesize,params,url,tbody,callback,pagediv,prepages_input,page_div) |
A |
2 |
{ |
|
3 |
params.page=page; |
|
4 |
params.pagesize=pagesize; |
|
5 |
jQuery.post(url, parmas, function(data, textStatus, xhr) { |
|
6 |
if(data==null) |
|
7 |
return; |
|
8 |
var items=data.items; |
|
9 |
var pages=data.pages; |
|
10 |
|
|
11 |
var tbobj=$(tbody); |
|
12 |
tbobj.empty(); |
|
13 |
if(callback!=null) |
|
14 |
{ |
|
15 |
jQuery.each(items, function(index, val) { |
|
16 |
var str=callback(index,val); |
|
17 |
jQuery.append(str); |
|
18 |
}); |
|
19 |
} |
|
20 |
|
|
21 |
if(prepages_input!=null) |
|
22 |
{ |
|
23 |
var prepages=prepages_input.val(); |
|
24 |
if(prepages!=pages) |
|
25 |
{ |
|
26 |
prepages_input.val(pages); |
|
27 |
jQuery(pagediv).bootpag({total:pages,maxVisible:10,page:page+1}).on('page',function(event,num){ |
|
28 |
getlist(num-1,pagesize,params,url,tbody,callback,pagediv); |
|
29 |
}); |
|
30 |
} |
|
31 |
} |
|
32 |
if(page_div!=null) |
|
33 |
page_div.val(page); |
|
34 |
},'json'); |
|
35 |
} |