-
Notifications
You must be signed in to change notification settings - Fork 1
/
demo.html
69 lines (65 loc) · 1.68 KB
/
demo.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
<!DOCTYPE html>
<html>
<head>
<meta charset='utf-8'/>
<title>页面列表分页测试实例</title>
<style>
textarea {
border:2px solid #ccc;
padding: 10px;
vertical-align: top;
width: 25%;
}
</style>
<script src='/libs/jquery/1.10.1/jquery.min.js'></script>
<script src='/jquery.dataPagination.js'></script>
<script>
$(function(){
//$('.normal').autosize();
//$('.animated').autosize();
/*
var opt = {
url : "data/list1.json",
data:"title=新闻消息来源&chinel=news",
pageSize:10,
timeout: 10000,
currentPage: 1,
autoLoad:true,
columns : [{ title: '新闻消息来源', width: 150, dataIndex: 'c', renderer:function(value,obj){
return value+':'+obj.d;
}}],
pagingBar:true,
pagingBarId: "paginationholder",
callback: null
};
*/
var opt = {
url : "/data/list1.json",
data:"currentPage=1&channelType=news",
pageSize:10,
timeout: 10000,
currentPage: 1,
channelType:'news',
pagingBarId: "paginationholder",
callback: function(result){
var pageWrap = $('#'+opt.pagingBarId);
pageWrap.html('');
var db=[];
for(var i=0;i<opt.pageSize;i++){
db.push('<img style="max-width:50px;" src='+result.dataList[i].relevantPhoto+'>');
db.push('<div>'+result.dataList[i].title+'</div>');
db.push('<div>'+result.dataList[i].showTime+'</div>');
}
pageWrap.append(db.join(''));
}
};
$("div.normal").pagination(opt);
});
</script>
</head>
<body>
<div>1、列表分页</div>
<div class='normal'>没有数据源.</div>
<div id='paginationholder'>页码.</div>
</body>
</html>