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

        var callBack = function() {
        };

        var datalist = jQ('#purchaseInvoice-datalist').DataTable({

            'processing': true,
            'serverSide': true,
            'ajax': {
                'url': purchaseInvoice.settings.ajaxUrl,
                'data': function(d) {
                    d.status = jQ('#purchaseInvoice-status').val();
                    d.url = global.settings.url;
                }
            },
            'columnDefs': [
                { 'orderable': false, 'targets': 8 },
                { 'searchable': false, 'targets': 8 }
            ],
            'order': [[1, 'desc']],
            drawCallback: function() {
                callBack();
            },
            responsive: {
                details: {
                    renderer: function( api,rowIdx ) {
                        return global.dataTableResponsiveCallBack(api, rowIdx, callBack);
                    }
                }
            }
        });


        jQ('#purchaseInvoice-status').change(function(){
            datalist.draw();
        });

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