-
Notifications
You must be signed in to change notification settings - Fork 2
/
Server Side Page
82 lines (71 loc) · 2.44 KB
/
Server Side Page
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
<!--<!DOCTYPE html>-->
<html>
<head>
<title></title>
<meta charset="utf-8" />
<script src="https://code.jquery.com/jquery-3.1.0.js"></script>
<link href="https://nightly.datatables.net/css/jquery.dataTables.css" rel="stylesheet" type="text/css" />
<script src="https://cdn.datatables.net/1.10.13/js/jquery.dataTables.js"></script>
<script>
$(document).ready(function () {
var table = $('#example').DataTable({
"processing": true,
"serverSide": true,
"columns": [
{ "data": "name" },
{ "data": "position" },
{ "data": "office" },
{ "data": "extn" },
{ "data": "start_date" },
{ "data": "salary" }
],
"select":"multi",
"lengthMenu": [5, [10, 15, 25, 50, -1], [5, 10, 15, 25, 50, "All"]],
"pageLength": 5,
"ajax": {
contentType: "application/json; charset=utf-8",
url: "wsSample.asmx/GetDTDataUnserializedObject",
type: "Post",
// compensate for where .net puts the data in the d object
dataSrc:"d.data",
data: function (dtParms) {
// notice dtParameters exactly matches the web service parameter name
return JSON.stringify({ dtParameters: dtParms });
},
error: function (error) {
console.log(x);
}
},
order: [[0, 'asc']]
});
});
</script>
</head>
<body>
<button type="button" id="btnDraw">Draw</button>
<table width="100%" class="display" id="example" cellspacing="0">
<thead>
<tr>
<th>Name</th>
<th>Position</th>
<th>Office</th>
<th>Phone</th>
<th>Start date</th>
<th>Salary</th>
</tr>
</thead>
<tfoot>
<tr class="searchRow">
<th>Name</th>
<th>Position</th>
<th>Office</th>
<th>Phone</th>
<th>Start date</th>
<th>Salary</th>
</tr>
</tfoot>
</table>
<script>
</script>
</body>
</html>