jquery ui helper mvc Select event

190 views Asked by At

I'm trying to access "select" event when user select from jquery ui autocomplete populated list i want to fire an event when jquery ui autocomplete "Select" event called.
My Problem is
I am using JqueryUiHelper MVC and dont know how to use select event using htmlHelper http://jqueryuihelpers.apphb.com/Docmo/Autocomplete

@using JQueryUIHelpers
    @Html.JQueryUI().AutocompleteFor(x => x.SearchText, Url.Action("SearchFilter"), new { @class = "form-control", placeholder = "Company name here for search..", style = "max-width:none;" }
                     )
@section Styles {
    @Styles.Render("~/Content/jqueryui")
}

@section Scripts {
    @Scripts.Render("~/bundles/jqueryui")
}

any help would be greatly appreciated.

1

There are 1 answers

0
Umair Anwaar On BEST ANSWER

I came with solution got from https://api.jqueryui.com/autocomplete/#event-select
Bind an event listener to the autocompleteselect event:

$(function () {
        $("#SearchText").on("autocompleteselect", function (event, ui) {

            event.preventDefault();
            $(this).val(ui.item.value);
            $('#btnGo').click();

        });
    });