bloodhound

Typeahead.js - Search in multiple property values

懵懂的女人 提交于 2019-11-30 04:34:55
Please see example below. JSFiddle: http://jsfiddle.net/R7UvH/2/ How do I make typeahead.js (0.10.1) search for matches in more than one property value? Ideally, within whole data ( data.title , data.desc and in all data.category[i].name ) datumTokenizer: function(data) { // **search in other property values; e.g. data.title & data.desc etc..** return Bloodhound.tokenizers.whitespace(data.title); }, Whole example: var data = [{ title: "some title here", desc: "some option here", category: [{ name: "category 1", }, { name: "categoy 2", }] }, { title: "some title here", desc: "some option here",

How to send data in request body when using Typeahead & Bloodhound?

不羁岁月 提交于 2019-11-29 16:56:39
I'm trying to implement a typeahead whose source is an API that expects a GET request with a body of data, not url encoded data. I've tried a few different things in the 'prepare' object, but can't get it to url encode parameters. Is it possible with typeahead, or jquery in general, to have it not do this? I have a feeling jquery maybe just doesn't let you do this, since it would be considered 'bad practice', but changing the API is not really an option! Here is my code: $(document).ready(function(){ var people = new Bloodhound({ datumTokenizer: Bloodhound.tokenizers.obj.whitespace('value'),

TypeAhead.js and Bloodhound showing an odd number of results

假装没事ソ 提交于 2019-11-29 06:20:11
I have a TypeAhead/Bloodhound implementation in my frontend, that fetches JSON-data from a Play/Scala-server. Typeahead-version is 0.11.1. The implementation is as follows: HTML: <div id="typeahead" class="col-md-8"> <input class="typeahead form-control" type="text" placeholder="Select the user"> </div> JavaScript: var engine = new Bloodhound({ datumTokenizer: function (datum) { var fullName = fullName(datum); return Bloodhound.tokenizers.whitespace(fullName); }, queryTokenizer: Bloodhound.tokenizers.whitespace, identify: function(obj) { return obj.id; }, remote: { url: routes.controllers

Typeahead.js - Search in multiple property values

馋奶兔 提交于 2019-11-29 01:48:04
问题 Please see example below. JSFiddle: http://jsfiddle.net/R7UvH/2/ How do I make typeahead.js (0.10.1) search for matches in more than one property value? Ideally, within whole data ( data.title , data.desc and in all data.category[i].name ) datumTokenizer: function(data) { // **search in other property values; e.g. data.title & data.desc etc..** return Bloodhound.tokenizers.whitespace(data.title); }, Whole example: var data = [{ title: "some title here", desc: "some option here", category: [{

TypeAhead.js and Bloodhound showing an odd number of results

£可爱£侵袭症+ 提交于 2019-11-28 00:09:06
问题 I have a TypeAhead/Bloodhound implementation in my frontend, that fetches JSON-data from a Play/Scala-server. Typeahead-version is 0.11.1. The implementation is as follows: HTML: <div id="typeahead" class="col-md-8"> <input class="typeahead form-control" type="text" placeholder="Select the user"> </div> JavaScript: var engine = new Bloodhound({ datumTokenizer: function (datum) { var fullName = fullName(datum); return Bloodhound.tokenizers.whitespace(fullName); }, queryTokenizer: Bloodhound

Twitter's typeahead-bloodhound: What is the equivalent of “%QUERY” when using ajax.data and POST?

﹥>﹥吖頭↗ 提交于 2019-11-27 08:17:31
问题 If one uses Bloodhound with GET: // Typeahead personsBloodhound = new Bloodhound({ datumTokenizer: function (person) { return person.name; }, queryTokenizer: Bloodhound.tokenizers.whitespace, remote: { url: '/ajax/Persons/List?nameContains=%QUERY', ajax: { beforeSend: function(xhr) { $(".searching-person").show(); }, data: { "pageSize": 4, "otherParam1": "blah", "otherParam2": "bleh", } }, filter: function (response) { $(".searching-person").hide(); return response.persons; } } }); One simply