jeudi 23 juin 2016

Typeahead not populates value

I am using typeahead where i am using ajax call to fetch data from controller. I am getting data in OnSuccess method but it's not populating. Below is my code:

        hint: true,
        highlight: true,
        minLength: 1
        limit: 12,
        async: true,
        source: function (query, process) {
            return $.ajax({
                url: "/Home/GetJsonData",
                type: 'POST',
                data: { query: query },
                dataType: 'json',
                success: function (json) {
                    var matches = [];
                    $.each(json, function (i, str) {
                    return process(matches);
<input type="text" id="search-input" class="form-control" />

How do i achieve the same?

Aucun commentaire:

Enregistrer un commentaire