Showing 1 to NaN of NaN entrie
Showing 1 to NaN of NaN entrie
chinnataroz
Posts: 1Questions: 1Answers: 0
$(document).ready(function () {
console.log("Test");
var table = $('#table').dataTable({
order: [[0, "desc"]],
pageLength: 50,
bLengthChange: false,
bFilter: false,
bJQueryUI: true,
processing: true,
bInfo: true,
infoFiltered: "30",
bServerSide: true,
aoColumnDefs: [
{ aTargets: [0], sClass: "text-center", bSortable: true, visible: true, sWidth: '15%' }, // ลำดับ
{ aTargets: [1], sClass: "text-right", bSortable: false, visible: true, sWidth: '20%' },
{ aTargets: [2], sClass: "text-right", bSortable: false, visible: true, sWidth: '20%' },
{ aTargets: [3], sClass: "text-right", bSortable: false, visible: true, sWidth: '5%' },
{ aTargets: [4], sClass: "text-right", bSortable: false, visible: true, sWidth: '5%' },
{ aTargets: [5], sClass: "text-right", bSortable: false, visible: true, sWidth: '5%' },
{ aTargets: [6], sClass: "text-right", bSortable: false, visible: true, sWidth: '5%' },
{ aTargets: [7], sClass: "text-right", bSortable: false, visible: true, sWidth: '5%' },
//{ aTargets: [8], sClass: "text-right", bSortable: false, visible: true, sWidth: '5%' },
],
ajax: {
url: '@Url.Action("GetLeave", "LeaveAPI",new { IsAdmin=ViewBag.IsAdmin })',
data: function (d) {
return $.extend({}, d, {}/*filterOptions*/);
},
type: "post",
dataSrc: function (json) {
console.log(json);
https://datatables.net/forums/uploads/editor/3p/hvwwoampazp4.png
This discussion has been closed.
Answers
Can you provide the Ajax response too, please. The problem is that this likely in an incompatible format. See the examples here for expected format.