-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathFrontend-DataTableRequest-Object.js
More file actions
25 lines (24 loc) · 1015 Bytes
/
Frontend-DataTableRequest-Object.js
File metadata and controls
25 lines (24 loc) · 1015 Bytes
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
var table = $('#id_of_your_table').DataTable({
'searchable': true,
"ordering": true,
"serverSide": true,
responsive: true,
processing: true,
ajax: {
"url": "/url_to_your_controller_method",
"type": "POST",
"data": function (data) {
return JSON.stringify({ dtParms : data});
}
},
"columnDefs": [
{
"targets": 0,
"data": "The_name_of_the_column0", //Must be the same as the name of the column in the results that you return
},
{
"targets": 1,
"data": "The_name_of_the_column1",
}
]
});