"ajax": {
"url": "${base}/platform/sys/systask/data",
"type": "post",
"data": function (d) {
}
}
3 回复
这个是ajax请求列表,成功则渲染,不成功没有任何反应了,比如登陆失效
function initDatatable() {
datatable = $('.datatable').DataTable({
"dom": '<"toolbar">frtip',
"searching":false,
"processing": false,
"serverSide": true,
"select": true,
"ordering": true,
"language": {
"url": "${base}/assets/plugins/datatables/cn.json"
},
"preDrawCallback": function () {
sublime.showLoadingbar($(".main-content"));
},
"drawCallback": function () {
sublime.closeLoadingbar($(".main-content"));
},
"ajax": {
"url": "${base}/platform/sys/systask/data",
"type": "post",
"data": function (d) {
},
},
"columns": [
{"data": "name", "bSortable": true},
{"data": "jobClass", "bSortable": true},
{"data": "cron", "bSortable": true},
{"data": "disabled", "bSortable": true},
{"data": "exeAt", "bSortable": true},
{"data": "exeResult", "bSortable": true}
],
});
datatable.on('click', 'tr', function () {
$(this).toggleClass('selected');
});
$("#searchBtn").on('click', function () {
datatable.ajax.reload();
});
}
添加回复
请先登陆