0
am using Bootstrap-3-Typeahead plugin that should work simply.
My server-side method is right, bringing the selection options but not a list. From what I read in git, it doesn’t even need extra css, but it doesn’t list.
Follows my code:
$("#pesquisa").typeahead({
source: function (query) {
return $.get("/Estabelecimento/GetDados", { q: query });
},
minLength: 3
});
<div class="container">
<div class="row">
<div class="col-md-12">
<div class="input-group">
<input type="text" id="pesquisa" name="pesquisa" class="form-control typeahead" autocomplete="off" placeholder="Pesquisar" />
<div class="input-group-btn"><button class="btn btn-primary">Pesquisar</button></div>
</div>
</div>
</div>
</div>
As you reported, it lists the names as image attached and the search works by Ameri, Son, etc.. but my initial idea would be to perform in another service column and list the establishment names based on what the user type, for example.. if he type Cacau, list Ameircanas and Carrefou, because in these two column services have this word base nase data. Or this plugin only works that way you reported?
– Ivan Teles
This is basic operation, I think it is possible to accomplish what you ask. Please mark this answer as correct (please reward the effort) as it responds to your request and opens a new one.
– Jorge Costa
I think it’s clearer now -> https://answall.com/questions/316058/bootstrap-3-typeahead-listar-op%C3%A7%C3%B5es-with-base-on-search-showing-other-field
– Ivan Teles