function initializeDevices() {
    $dataTable = $('#mainGrid');
    $dataTable.DataTable({
        ajax: {
            url: $dataTable.attr('data-url'),
            data: function (d) {
                d.Keywords = $("#Keywords").val();
            }
        },
        columns: [
            { data: "DeviceNumber", name: "DeviceNumber", filtertype: "number" },
            { data: "Description", name: "Description", filtertype: "text" },
            { data: "DeviceType", name: "TRwRefPosDeviceType.DeviceTypeCode", filtertype: "text" },
            { data: "CompanyUnitId", name: "TPaSetDocType.AcWorkPlace", filtertype: "text" },
            { data: "IsActivated", name: "IsActivated", render: $.fn.dataTable.render.toggle('Y'), className: 'dt-body-center' },
            { data: "IsMasterDevice", name: "IsMasterDevice", render: $.fn.dataTable.render.toggle('Y'), className: 'dt-body-center' },
            { data: "DevicePassword", name: "Password", filtertype: "text" },
            { data: "MBNumber", name: "", orderable: false },
            { data: "IsFiscalCertDownloaded", name: "IsFiskalCertDownloaded", render: $.fn.dataTable.render.toggle('Y'), className: 'dt-body-center' },
            { data: "LastChangeTime", name: "VersionUts", filtertype: "dateTime" },
            { data: "LastSync", name: "", orderable: false, filtertype: "dateTime" }
        ]
    });

    $("select").off("change.tableReload");
    $("select").on("change.tableReload", function () {
        $.fn.dataTable.reload($dataTable);
    });

    var typingTimer;
    var doneTypingInterval = 600;
    $('#Keywords').off('keyup');
    $('#Keywords').on('keyup', function () {
        clearTimeout(typingTimer);
        typingTimer = setTimeout(function () { $.fn.dataTable.reload($dataTable); }, doneTypingInterval);
    });
}