NewsPen/static/js/maillist.js

51 lines
1.4 KiB
JavaScript
Raw Normal View History

2017-12-16 14:06:39 -07:00
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
2018-02-03 21:08:30 -07:00
var table = $('#listtable').DataTable({
responsive: {
details: {
display: $.fn.dataTable.Responsive.display.modal({
header: function (row) {
var data = row.data();
2018-02-03 21:08:30 -07:00
return "<i class=\"fa fa-envelope fa-fw\"></i> " + data[2];
}
}),
renderer: $.fn.dataTable.Responsive.renderer.tableAll({
tableClass: 'table'
}),
type: "column"
}
},
columnDefs: [
{
targets: 0,
className: 'control',
orderable: false
},
{
targets: 1,
orderable: false
},
],
order: [
2018-02-03 21:08:30 -07:00
[1, 'asc']
],
serverSide: true,
ajax: {
2018-02-03 21:08:30 -07:00
url: "lib/getlisttable.php",
dataFilter: function (data) {
var json = jQuery.parseJSON(data);
json.data = [];
2018-02-03 21:08:30 -07:00
json.lists.forEach(function (row) {
json.data.push([
"",
row.editbtn + " " + row.clonebtn,
2018-02-03 21:08:30 -07:00
row.listname,
row.count
]);
});
return JSON.stringify(json);
}
}
});