

<script src="/js/plugins/chosen/chosen.ajaxaddition.jquery.js"></script>
<script>
$('.assigned-user-ajax').each(function () {
    $(this).ajaxChosen({
        dataType: 'json',
    }, {
        processItems: function (data) { return data },
        generateUrl: function (q) { return '/get-filter-fields-assigned-user?search=' + q; },
    },
        {
            width: "100%"
        }).change(function () {
            $(this).closest('.form-group').next().find('input').focus();
        });
});

$('.ajax-user').each(function () {
    $(this).ajaxChosen({
        dataType: 'json',
    }, {
        processItems: function (data) { return data },
        generateUrl: function (q) { return '/get-filter-fields-user?search=' + q; },
    },
        {
            width: "100%"
        });
});

$('.filter-field-storage-location').each(function () {
    $(this).ajaxChosen({
        dataType: 'json',
    }, {
        processItems: function (data) { return data },
        generateUrl: function (q) { return '/get-filter-storage-location?search=' + q; },
    },
        {
            width: "100%"
        });
});


$('.filter-field-install-building-location').each(function () {
    $(this).ajaxChosen({
        dataType: 'json',
    }, {
        processItems: function (data) { return data },
        generateUrl: function (q) { return '/get-filter-install-building-location?search=' + q; },
    },
        {
            width: "100%"
        });
});

$('.filter-field-install-location').each(function () {
    $(this).ajaxChosen({
        dataType: 'json',
    }, {
        processItems: function (data) { return data },
        generateUrl: function (q) { return '/get-filter-install-location?search=' + q; },
    },
        {
            width: "100%"
        });
});

$('.filter-field-installed-location').each(function () {
    $(this).ajaxChosen({
        dataType: 'json',
    }, {
        processItems: function (data) { return data },
        generateUrl: function (q) { return '/get-filter-installed-location?search=' + q; },
    },
        {
            width: "100%"
        });
});

$('.filter-field-all-active-location').each(function () {
    $(this).ajaxChosen({
        dataType: 'json',
    }, {
        processItems: function (data) { return data },
        generateUrl: function (q) { return '/get-filter-fields-location?search=' + q+'&type=room_name' },
    },
        {
            width: "100%"
        });
});

</script>