相关连接
Features Callbacks Columns Options Internationalisation
Data - 数据部分
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
var table = $('#example').DataTable( {
"ajax": {
"url": "data.json",
"type": "POST",
"dataSrc": "data",
"data": {
"user_id": 451
}
},
"data": [
{
"name": "Tiger Nixon",
"position": "System Architect",
"salary": "$3,120",
"start_date": "2011/04/25",
"office": "Edinburgh",
"extn": 5421
},
{
"name": "Garrett Winters",
"position": "Director",
"salary": "5300",
"start_date": "2011/07/25",
"office": "Edinburgh",
"extn": "8422"
},
// ...
],
//这里是为了配合上面的data,所以要写出了,之后会有对 columns 更详细的结构
"columns": [
{ "data": "name" },
{ "data": "position" },
{ "data": "office" },
{ "data": "extn" },
{ "data": "start_date" },
{ "data": "salary" }
]
} );
PS:以上代码无任何实际使用价值,纯粹演示对象结构,和新版参数的写法