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

        var callBack = function() {
        };

        var datalist = jQ('#materialRequisition-datalist').DataTable({
            
            'processing': true,
            'serverSide': true,
            'ajax': {
                'url': materialRequisition.settings.ajaxUrl,
                'data': function(d) {
                    d.status = jQ('#materialRequisitionFilter-status').val();
                    d.url = global.settings.url;
                }
            },
            'columnDefs': [
                { 'orderable': false, 'targets': 5 },
                { 'searchable': false, 'targets': 5 }
            ],
            drawCallback: function() {
                callBack();
            },
            responsive: {
                details: {
                    renderer: function( api,rowIdx ) {
                        return global.dataTableResponsiveCallBack(api, rowIdx, callBack);
                    }
                }
            }
        });

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

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