function initializeMeasurementUnits() {
    $("#Keywords").attr('placeholder', $('#searchPlaceholder').val());

    $dataTable = $('#mainGrid');
    $dataTable.DataTable({
        ajax: {
            url: $dataTable.attr('data-url'),
            data: function (d) {
                d.Keywords = $("#Keywords").val();
            }
        },
        columns: [
            { data: "Id", name: "AcUm", filtertype: "text", render: $.fn.dataTable.render.link("Id") },
            { data: "InterCode", name: "AcInterUm", filtertype: "text", render: $.fn.dataTable.render.link("Id") },
            { data: "Name", name: "AcName", filtertype: "text", render: $.fn.dataTable.render.link("Id") }
        ]
    });

    $("select").off("change");
    $("select").on("change", 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);
    });
}

function initializeMeasurementUnitsEdit() {
    $('#Id').focus();

    $('.input-validation-error').parents('.form-group').addClass('has-error');
    $('.field-validation-error').addClass('text-danger');
}