1
2
3
4
5
6
7
8
9
10 td11 {
12 text-align:center;
13 }
14
15
16 $(function() {17 $("#but").attr("disabled",false);18 });19 //(全/反)选:
20 functiongetChk() {21 if($("#ch").attr("checked")) {22 $(".chk").attr("checked",true);23 }else{24 $(".chk").attr("checked",false);25 }26 }27 //利用AJAX将数据发送到后台并判断数据选中情况方法:
28 functionsendData() {29 varsendValue= "";30 $(".chk").each(function(i,chk) {31 if(chk.checked) {32 sendValue+=$.trim($(chk).parent().parent().find(".getData").text());33 sendValue+= ",";34 }35 })36 if(sendValue.length== 0) {37 alert("请选择需要传输的数据!!");38 return;39 }40 sendValue=sendValue.substr(0, sendValue.length- 1);41 //开始ajax to asp.net:
42 $.ajax({43 type:"post",44 contentType:"application/json",45 url:"Index.aspx/GetAjaxValue",46 data:"{sendValue:'" +sendValue+ "'}",47 beforeSend:function() {48 $("#but").attr("disabled",true);49 },50 success:function(data) {51 alert(data.d);52 }, complete:function() { }, error:function() { }53 })54 }55
56
57
58
59
60
61
62
63 全选
64
65
66 数据67
68
69
70
71
72
73
74 123475
76
77
78
79
80
81
82 567883
84
85
86
87
88
89
90 1234567891
92
93
94
95
96
97
98 8765432199
100
101
102
103
104
105
106
107