var auditTrail = {
    settings: {
        ajaxUrl: ''
    },
    init: function() {
        auditTrail.initDataTable();
    },
    initDataTable: function() {

        // var callBack = function() {
        // };

        var dataList = jQ('#auditTrail-datalist').DataTable({
            processing: true,
            serverSide: true,
            ajax: {
                url: auditTrail.settings.ajaxUrl,
                data: function(d) {
                    d.url = global.settings.url;
                    d.transaction = jQ('#transaction').val();
                    d.action = jQ('#action').val();
                    d.table = jQ('#table').val();
                    d.id = jQ('#id').val();
                }
            },
            deferRender: true,
            columnDefs: [
                {orderable: false, targets: 5},
                {searchable: false, targets: 5}
            ],
            ordering: false,
            searching: false,
            bInfo: false,
            //order: [[0, 'desc']],
            orderClasses: false,
            //drawCallback: callBack,
            responsive: {
                details: {
                    renderer: function(api, rowIdx) {
                        //return global.dataTableResponsiveCallBack(api, rowIdx, callBack);
                        return global.dataTableResponsiveCallBack(api, rowIdx);
                    }
                }
            }
        });

        jQ('.content-container').removeClass('has-loading');
        jQ('.content-container-content').removeClass('hide');

        jQ('#auditTrail-datalist').on('init.dt', function () {
            jQ(".filter")
                .attr('placeholder', 'Press Enter to Search')
                .unbind()
                .bind("keyup", function(e) {
                    if(e.keyCode === 13) {
                        dataList.search(this.value).draw();
                    }
                });
        });
    }
};