Typeahead + Bloodhound not refreshing

Racking my brains here hoping for some help. I have successfully implemented bootstrap 3 typeahead (https://github.com/bassjobsen/Bootstrap-3-Typeahead) and it is showing suggestions from my JSON as expected. var employer = new Bloodhound({ datumTokenizer: Bloodhound.tokenizers.whitespace, queryTokenizer: Bloodhound.tokenizers.whitespace, remote: { url: "/employers.json", cache: "false"} }); employer.initialize(); $("#employer").typeahead({ source:employer.ttAdapter() });However the issue I have is when...Read more

Is it possible to Style Angular-Strap TypeAhead

I am using AngularStrap, (TypeAhead), trying to make the substring in the matched items to stand out, like either make them bold (like jquery autocomplete) or change the background of the characters ta different colorCalifornia Technical I thought this should be possible by changing css (if I know they have a selector for the matched substring) Or use of template/$templatecacheno luck so farEDIT: In this plnkr I can see the drop down menu items have user input highlighted/bolded but cannot see why and how it happens:<input type="text" class...Read more

angular strap - angularstrap typeahead with json object array is not working

I am using angularstrap typeahead directive. Its working fine with single object json values but its not working when replacing the json with my json object array.Demo Json: typeahead= ["Alabama","Alaska","Arizona","Arkansas","California","Colorado","Connecticut","Delaware","Florida","Georgia"];<input type="text" ng-model="typeaheadValue" bs-typeahead="typeahead">The above code is working fine.My JSON object array: typeahead = [ {id: 1, name: 'name1', email: 'email1@domain.com'}, {id: 2, name: 'name2', email: 'email2@domain.com'}, ...Read more

Dont want to allow manual tagging in bootstrap tokenfiled

I am using bootstrap-tokenfield http://sliptree.github.io/bootstrap-tokenfield/ with jquery autocomplete. I want tagging with autocomplete content(from dropdown only). When user is inputting something and hit enter key it automatically creates tags. I dont want to allow this feature to the users. Is there any option/flag to set it? Any help would be appreciated. Thanks in advance....Read more

How to change selection behaviour of Bootstrap's typeahead

When using the typeahead functionality from Twitter Bootstrap (example) the first suggestion gets selected when I press TAB and when I press ENTER. However, when a user does NOT want to use one of the suggestions there is only one way to achieve this and that is grabbing the mouse and clicking on the submit button.I want a way of doing this with only the keyboard, TAB or ARROW-UP both seem intuitive, but in both cases I can't get the default behaviour of Bootstrap to stop. I tried both preventDefault() and stopPropagation()....Read more

Bootstrap tags input with typeahead does not work

I want to restrict tags usage to only ones got from an API.The "Object as tags" example seems to be what I'm looking for, but typeahead doesn't seem to work as expected (no placeholder opens)<input id="tags" type="text"><script> var tags = new Bloodhound({ datumTokenizer: Bloodhound.tokenizers.obj.whitespace('name'), queryTokenizer: Bloodhound.tokenizers.whitespace, prefetch: 'http://example.com/tags' }); tags.initialize(); $('input#tags').tagsinput({ itemValue: 'id', itemText: 'name', typeahead: { name: '...Read more

typeahead.js - Typeahead Functionality

I'm about to do a cool auto complete field and am thinking of using Typeahead.jsI understand with Typeahead.js I can do custom html templates for the suggestions which is great.But I'm wondering can I also render whatever html I like for the value that is chosen from the suggestions?I want to display a little image alongside the value chosen.Just wanted to check it can be done before I deep dive typeahead.js...Read more

typeahead auto suggest implementation [comma / Space]

I have given auto suggestion part in my module using typeahead js . i have done following changes in my part - $('#input').typeahead({local:["Super","Beautiful","Perfect", "Good Looking"]});while i type like "goodlooking"(without space) value, i need to be display "good looking(with space)" value also in suggestion part. What should i do for this changes.Advance Thanks !!...Read more

Twitter Typeahead.js with Yahoo Finance in AJAX

I am trying to couple the new version of Typeahead.js and using it with JSON that needs to be pulled from AJAX and not from a JSON file like they have in their examples. I just can't get it to work, I don't want to cache the JSON result or anything, I want to pull it live from Yahoo.My HTML input is <input type="text" id="symbol" name="symbol" autofocus autocomplete="off" placeholder="Symbol" onkeyup="onSymbolChange(this.value)" />My AJAX/PHP file has this to retrieve data (this part work, I tested it with Firebug)header('Content-type:te...Read more

bootstrap typeahead url/redirect

$(function(){ var orthoObjs = {}; var orthoNames = []; var throttledRequest = _.debounce(function(query, process){ $.ajax({ url: 'json/ortho4.json' ,cache: false ,success: function(data){ orthoObjs = {}; orthoNames = []; _.each( data, function(item, ix, list){ orthoNames.push( item.searchPhr ); orthoObjs[ item.searchPhr ] = item; }); process( orthoNa...Read more

typeahead.js and bootstrap 3 change source on close dropdown

I have an input field in bootstrap 3 and I want to make it autocomplete with values from some local data, so I chose bootstrap-typeahead. The problem is that when the user chooses some value, I want to change the source of typeahead so that this value is no longer included in the available options. I have simplified a jsfiddle because the only thing that I can't do is change the source. The following code doesn't work.autocomplete.on('typeahead:closed', function( i, j) {//change source autocomplete.data('typeahead').source = altdata.ttAdapter...Read more

Twitter Typeahead data passing

I'm using twitter typeahead bundle. I have code like this: var results = new bloodhound({...}) //results is a map in json with the keys ID and displayName. It's grabbed by ajax call. $('#element').typeahead({ ... { name: 'Results', displayKey: 'displayName', source: results.ttAdapter(), }...This works very, very well. The results are being populated as users type stuff. However, one issue I have is that when the user clicks "submit", the value I need to grab is not the displayName, but instead the ID. If the use...Read more

bootstrap lable and id display error

I have a jason complex object containing, first name, last name, middkle name, FH name and agent ID. I am uisng bootstrap-typehead for making an ajax call to fetch results. User can enter either first name, last name or agent id. I wouldl ike to show all above fields as lables and agent Id as id. I am geting undefined error.DEMO $('#selectAgent').typeahead({source: function (query, process) { objects = []; map = {}; var data = [{"AgentID": 3456,"FName": "Gary", "LName": "Means","MName": "K","FHName": "GaryFH Name"}, {"AgentID": 2050,"F...Read more