- 注册时间
- 2016-9-21
- 最后登录
- 1970-1-1
- 阅读权限
- 150
- 积分
- 821
- 精华
- 0
- 帖子
- 275
 
|
本帖最后由 jialiang 于 2017-3-9 12:06 编辑
你可以用onbeforeselect事件来获取改变值之前的值(这里是代码,复制粘贴就可使用):- <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
- <html xmlns="http://www.w3.org/1999/xhtml">
- <head>
- <title></title>
- <script src="http://www.miniui.com/scripts/boot.js" type="text/javascript"></script>
- </head>
- <body>
- <div id="demo1" class="mini-checkboxlist" textField="text" valueField="id" value="cn,usa"
- repeatItems="3" repeatLayout="table" onvaluechanged="change()" onbeforeselect="alert(this.getValue())">
-
- </div>
-
- <script>
- mini.parse();
- var s = [
- { "id": "usa", "text": "美国" },
- { "id": "cn", "text": "中国" },
- { "id": "jp", "text": "日本", enabled: false },
- { "id": "de", "text": "德国" },
- { "id": "fr", "text": "法国" },
- { "id": "ca", "text": "加拿大" },
- { "id": "at", "text": "奥地利" },
- { "id": "ch", "text": "瑞士" }
- ];
- var cblist1 = mini.get("demo1");
- cblist1.loadData(s);
- function change() {
- alert(cblist1.getValue());
- }
- </script>
- </body>
- </html>
复制代码
|
|