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

        var callBack = function() {
        };

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

        jQ('#active-filter').on('change', function(){
            dataList.draw();
        });

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