Injoker
6/12/2018 - 10:35 AM

DATATABLES + aspboilerblate

var tableData = {
    draw: 0,
    recordsTotal: 0,
    recordsFiltered: 0,
    data: []
};
$("#datatable_auditlogs").DataTable({
    processing: true,
    serverSide: true,
    columns: [
        { data: 'id' },
        { data: 'tenantId' },
        { data: 'userId' },
        { data: 'serviceName' },
        { data: 'methodName' },
        { data: 'parameters' },
        { data: 'executionTime' },
        { data: 'executionDuration' },
        { data: 'clientIpAddress' },
        { data: 'clientName' },
        { data: 'browserInfo' },
        { data: 'exception' },
    ],
    ajax: function (data, callback, settings) {
        abp.services.app.auditLog.getPaged({
            skipCount: data.start,
            maxResultCount: data.length
        }).done(function (result) {
            tableData.draw = data.draw;
            tableData.recordsTotal = result.totalCount;
            tableData.recordsFiltered = result.totalCount;
            tableData.data = result.items;
            callback(tableData);
        });
    }
});