
        function InitDatatable() {
            $('#datatable-1').on('xhr.dt', function (e, settings, json) {
                if (typeof (json.data) == 'object' && json.data.length >0) {
                    var date;
                    for (var i in json.data) {
                        var row = json.data[i];
                        for (var key in row) {
                            if (key == 'mac') {
                                var val = row[key];
                                json.data[i][key] = '<a href="{{app.request_context.baseUrl}}/users/edit-users?id=' + row.uid + '">'+ val +'</a>';
                            }
                        }    
                        date = json.data[i]['added'];
                        if (date > 0) {
                            date = new Date(date * 1000);
                            json.data[i]['added'] = date.toLocaleFormat("%b %d, %Y %H:%M");
                        }
                        delete(json.data[i].uid);
                    }
                }
            }).dataTable({
                "processing": true,
                "serverSide": true,
                "ajax": {
                    "url": "{{ app.request_context.baseUrl }}/{{ app.controller_alias }}/stat-claims-logs-list-json"
                },
                "language": {
                    "url": "{{ app.datatable_lang_file }}"
                },
                {% if attribute(app, 'dropdownAttribute') is defined %}
                {{ main_macro.get_datatable_column(app['dropdownAttribute']) }}
                {% endif %}
                "bFilter": true,
                "bPaginate": true,
                "lengthChange": true,
                "bInfo": true,

                "fixedHeader": {
                    header: true,
                    headerOffset: $('header.navbar').height()
                },

                "columnDefs": [{"searchable": false, "targets": [-1, 0, 2]}]
            }).prev('.dataTables_processing').hide();
        }

        function yelp() {
            $(document).ready(function () {
                LoadDataTablesScripts(InitDatatable);
            });
        }

        document.addEventListener("DOMContentLoaded", yelp, false);
