demo.html
1.41 KB
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
<div id="page_1" class="page out">
<a href="javascript:;" onclick="getListCheckedData()">点击获取选中数据</a>
<div class="checked-datas">当前选中数据为:
<i id="checkedDatas">[]</i>
</div>
<abbr id="C6AABD3251C00001F1D7101317B1A7D0" data-type="UrlList"></abbr>
</div>
<style>
.checked-datas {
padding: 5px 16px;
color: #666;
}
a {
display: block;
padding: 5px 16px;;
color: #108ee9;
text-decoration: underline;
}
</style>
<script>
function getListCheckedData () {
Mobile_NS.getListCheckedData(function (datas) {
var datasStr = JSON.stringify(datas);
document.getElementById("checkedDatas").innerHTML = datasStr;
});
}
/**
* 以下代码为页面插件的初始化,demo效果所需,无需关注
**/
require(["UrlList"], function (UrlList) {
var option = {
url: "/mobilemode/mobile/demo/plugin/UrlList/data.jsp",
pageSize: 3,
dataOption: true,
showset: {
titlefield: "{title}",
imgfield: "<img src='{avatar}' style='width:40px;height:40px;border-radius:40px;'/>",
otherfields: [
"内容:{content}",
"分类:{cat}",
"日期:{date}"
]
},
searchTips: "输入关键字"
};
new UrlList({
el: "C6AABD3251C00001F1D7101317B1A7D0",
option: option
}).render();
});
</script>