Monday, 26 August 2013

jquery typeahead and address picker?

jquery typeahead and address picker?

With the release of bootstrap 3.0 the typeahead plugin has been removed
and replaced with Twitters typeahead plugin. Any idea how I can use this
in conjunction with the addresspicker plugin.
My old code worked like this:
$('#location').addressPicker({
boundElements: {
'#wizard .Country': function(data) {
var result = '';
$.each(data.address_components, function (index, value) {
if (value.types.indexOf('country') !== -1) {
result = value.long_name;
}
});
return result;
},
'#wizard .State': 'administrative_area_level_1',
'#wizard .City': 'locality',
'#wizard .PostalCode': 'postal_code',
'#wizard .Lat': 'lat',
'#wizard .Lng': 'lng'
}
});
The event trigger for the new type ahead looks like this:
$('#location').typeahead({
/* ??? */
});

No comments:

Post a Comment