-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.js
204 lines (174 loc) · 5.67 KB
/
index.js
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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
window.onload=function(){
/**
* *********************************************************************** Lazy_Switch *************************
*/
var instance_switch = new Lazy_Switch({
baseEl : '#instance_switch',
isOpen : true,
action : function() {
/* console.log(instance_switch.val); */
}
});
/**
* ************************************************************************ Lazy_datagrid *************************
*/
var instance_table = new Lazy_Table({
isFrontPagination:true,
baseEl:"#instance_table",
url:'lazy_datagrid/my.json',
childrenAttr:'childlist',
clickable:true,
datagrid_height:410,
parse:function(resp){
return{
list:resp
}
},
/*data:[{
name:"tenth",
number:"10",
temp:"yanpeiqiong"
},
{
name:"eleven",
number:"11",
temp:"tianyuanyuan"
}
}],*/
onItemClick : function(model) {
//alert("clicked!");
},
onCheckboxClick:function(models){
_(models).each(function(model,index){
/* console.log(model.name); */
})
},
toolbar:[
{
id : 'button1',
text : '操作1',
disabled : false,
handler : function() {
alert("clicked[操作1]!");
}
},
{
id : 'button2',
text : '操作2',
disabled : false,
handler : _(function() {
alert("clicked[操作2]!");
}).bind(this)
},
{
id : 'button3',
text : '操作3',
disabled : false,
handler : function() {
alert("clicked[操作3]!");
}
}
],
//showNumber:true,
showCheckbox:true,
isMultiSelect:true,//表示是否支持多选
columns : [
{
//sortable : true,
title : '昵称',
content : 'name',
formatter:function(value,rowData,rowIndex){
return value;
}
},
{
title : '工号',
content : 'number'
},
{
title : '姓名',
content : 'temp'
},
{
title : '结果',
content : 'result',
operations : function(value,rowData,rowIndex){
return "<img src='lazy_datagrid/images/event_right.png' style='cursor:default'>"
}
}
],
pager:{
pageNo:1,
pageSize:10,
}
});
/**
* *********************************************************************** Lazy_Tree *************************
*/
var instance_tree = new Lazy_Tree({
baseEl:"#instance_tree",
showCheckbox:false,
imgPosition:"lazy_tree/",
list:function(){
return [
{ "content":"超级管理组", "id":"1", "pid":"-1", "model":{"name":"超级管理组", "type":"admin"}},
{ "content":"系统管理组", "id":"11", "pid":"1", "model":{"name":"系统管理组", "type":"admin"}},
{ "content":"安全管理组", "id":"12", "pid":"1", "model":{"name":"安全管理组", "type":"admin"}},
{ "content":"审计管理组", "id":"13", "pid":"1", "model":{"name":"审计管理组", "type":"admin"}},
{ "content":"普通用户组", "id":"14", "pid":"1", "model":{"name":"普通用户组", "type":"admin"}},
{ "content":"系统用户子组1", "id":"111", "pid":"11", "model":{"name":"系统用户子组1", "type":"other"}},
{ "content":"系统用户子组2", "id":"112", "pid":"11", "model":{"name":"系统用户子组2", "type":"other"}},
{ "content":"普通用户子组1", "id":"141", "pid":"14", "model":{"name":"普通用户子组1", "type":"other"}},
{ "content":"普通用户子组2", "id":"142", "pid":"14", "model":{"name":"普通用户子组2", "type":"other"}},
{ "content":"普通用户子组3", "id":"143", "pid":"14", "model":{"name":"普通用户子组3", "type":"other"}},
{ "content":"普通用户1", "id":"1421", "pid":"142", "model":{"name":"普通用户1", "type":"other"}},
{ "content":"普通用户2", "id":"1422", "pid":"142", "model":{"name":"普通用户2", "type":"other"}},
{ "content":"普通用户3", "id":"1431", "pid":"143", "model":{"name":"普通用户3", "type":"other"}},
//{ "content":"guest2_sub1_sub1_r", "id":"14228", "pid":"1421", "model":{"name":"guest2_sub1_sub1_r", "type":"other"}}
//{ "content":"guest2_sub1_sub1_r", "id":"14228", "pid":"1421", "model":{"name":"guest2_sub1_sub1_r", "type":"other"}}
]
},
onItemClick:function(model) {
//alert(model.content);
},
rightMenu:{
list:[
[
{"optName":"修改备注名称", "optParam":"j1"},
{"optName":"举报此用户","optParam":"2"},
{"optName":"发送电子邮件","optParam":"3"}
],
[
{"optName":"会员快捷功能","optParam":"4","children":[
{"optName":"设置好友铃音","optParam":"41"},
{"optName":"设置QQ装扮","optParam":"42"},
{"optName":"好友上线通知","optParam":"43"}
]},
{"optName":"进入QQ空间","optParam":"5"}
]
],
optFunc:function(param,model){
/* console.log(param);
console.log(model); */
}
},
onRightClick:function(){
}
});
instance_tree.itemClickById("1");
//setTimeout('instance_tree.selectNode("1","id");',1000);
/**
* *********************************************************************** Lazy_Tree *************************
*/
$('#instance_progress1').Lazy_ProgressBar(75);
$('#instance_progress2').Lazy_ProgressBar(0);
$('#instance_progress2').Lazy_ProgressBar('setValue',0);
$("#btn_progress")[0].onclick = function(){
var value = $('#instance_progress2').Lazy_ProgressBar('getValue');
if (value < 100){
value += Math.floor(Math.random() * 10);
$('#instance_progress2').Lazy_ProgressBar('setValue', value);
setTimeout(arguments.callee, 200);
}
}
};