|
selectList模块(界面布局-列表)demo示例
[复制链接]
- <!DOCTYPE html>
- <html>
- <head>
- <meta charset="utf-8">
- <meta name="viewport" content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,width=device-width,initial-scale=1.0" />
- <meta name="format-detection" content="telephone=no,email=no,date=no,address=no">
- <title>title</title>
- <link rel="stylesheet" type="text/css" href="../css/api.css" />
- <style>
- body {
- }
- html, body {
- height: 100%
- }
- body {
- background-color: #fff;
- margin: 0;
- }
- a.button {
- display: -webkit-box;
- -webkit-box-orient: vertical;
- -webkit-box-pack: center;
- -webkit-box-align: center;
- height: 32px;
- margin: 8px;
- background-color: rgba(240, 240, 240, 1.0);
- border-color: rgba(220, 220, 220, 1.0);
- border-width: none;
- }
- a.active {
- background-color: rgba(240, 240, 240, 0.7);
- }
- </style>
- </head>
- <body>
- <a class="button" tapmode="active" onclick="fnClose()">关闭selectlist</a>
- <a class="button" tapmode="active" onclick="fnShow()">显示列表视图</a>
- <a class="button" tapmode="active" onclick="fnHide()">隐藏selectList列表视图</a>
- <a class="button" tapmode="active" onclick="fnDeleteItem()">删除指定索引的数据</a>
- <a class="button" tapmode="active" onclick="fnInsertItem()">插入指定索引的数据</a>
- <a class="button" tapmode="active" onclick="fnRefreshItem()">刷新指定index条目的数据</a>
- <a class="button" tapmode="active" onclick="fnSetSelected()">设置选中的条目</a>
- <a class="button" tapmode="active" onclick="fnGetSortedData()">获取排序后的所有的数据</a>
- <br />
- <br />
- <br />
- <br />
- <br />
- <br />
- <br />
- <br />
- <br />
- <br />
- <br />
- <br />
- <br />
- </body>
- <script type="text/javascript" src="../script/api.js"></script>
- <script type="text/javascript">
- var demo;
- apiready = function() {
- demo = api.require('selectList');
- fnOpen();
- };
- function fnOpen() {
- demo.open({
- x : 0,
- y : api.frameHeight - 250,
- w : api.frameWidth,
- h : 250,
- contents : [{
- title : '阿宝',
- subTitle : '131313131313'
- }, {
- title : '阿宝',
- subTitle : '131313131313'
- }, {
- title : '阿宝',
- subTitle : '131313131313'
- }, {
- title : '阿宝',
- subTitle : '131313131313'
- }, {
- title : '阿宝',
- subTitle : '131313131313'
- }, {
- title : '阿宝',
- subTitle : '131313131313'
- }, {
- title : '阿宝',
- subTitle : '131313131313'
- }, {
- title : '阿宝',
- subTitle : '131313131313'
- }],
- fixedOn : api.frameName,
- }, function(ret, err) {
- if (ret) {
- //alert(JSON.stringify(ret));
- id=ret.id;
- } else {
- alert(JSON.stringify(err));
- }
- });
- }
- function fnClose() {
- demo.close({
- id : id
- });
- }
- function fnShow() {
- demo.show({
- id : id
- });
- }
- function fnHide() {
- demo.hide({
- id : id
- });
- }
- function fnDeleteItem() {
- demo.deleteItem({
- id : id,
- index : 2
- });
- }
- function fnInsertItem() {
- demo.insertItem({
- id : id,
- index : 2,
- content : {
- title : 'APICloud',
- subTitle : '000000000'
- }
- });
- }
- function fnRefreshItem() {
- demo.refreshItem({
- id : id,
- index : 2,
- content : {
- title : 'apitest',
- subTitle : '111111'
- }
- });
- }
- function fnSetSelected() {
- demo.setSelected({
- id : id,
- index : 2,
- });
- }
- function fnGetSortedData() {
- demo.getSortedData({
- id : id
- }, function(ret, err) {
- if (ret) {
- alert(JSON.stringify(ret));
- } else {
- alert(JSON.stringify(err));
- }
- });
- }
- </script>
- </html>
复制代码 selectList模块demo
|
本帖子中包含更多资源,您需要 登录 才可以下载或查看,没有帐号?立即注册
X
|