参考网上,用原生JS粗糙实现。
我发现用UIKIT的BUTTON会自动刷新我那核心的模态窗口,只好用另外的LABEL或CODE标签了。
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
|
$( ".btn-select-all" ).click( function (){
var deploypool_id = $( this ).attr( "deploypool_id" )
var code_Values = document.getElementsByName( "check-server" + deploypool_id);
for (i = 0;i < code_Values.length;i++){
if (code_Values[i].type == "checkbox" ){
code_Values[i].checked = true ;
}
}
});
$( ".btn-select-reverse" ).click( function (){
var deploypool_id = $( this ).attr( "deploypool_id" )
var code_Values = document.getElementsByName( "check-server" + deploypool_id);
for (i = 0;i < code_Values.length;i++){
if (code_Values[i].type == "checkbox" ){
code_Values[i].checked = false ;
}
}
});
$( ".btn-select-half" ).click( function (){
var deploypool_id = $( this ).attr( "deploypool_id" )
var code_Values = document.getElementsByName( "check-server" + deploypool_id);
for (i = 0;i < code_Values.length;i++){
if (i % 2 == 0){
if (code_Values[i].type == "checkbox" ){
code_Values[i].checked = true ;
}
}
}
});
|