added template for autocomplete

This commit is contained in:
2015-10-06 16:18:04 +02:00
parent 82a91e2f2a
commit 9d6dfb50c5
+12 -2
View File
@@ -22,9 +22,14 @@ javascript:
$('#supporter_city').typeahead({
minLength: 2,
highlight: true,
},{
limit: 20,
display: 'city',
templates: {
suggestion: function (data) {
return '<p><strong>' + data.plz + '</strong> - ' + data.city + '</p>';
}
},
source: cities
}).on('typeahead:selected', function(event, datum) {
$("#supporter_zip").val(datum.plz);
@@ -32,9 +37,14 @@ javascript:
$('#supporter_zip').typeahead({
minLength: 2,
highlight: true,
},{
limit: 20,
display: 'plz',
templates: {
suggestion: function (data) {
return '<p><strong>' + data.plz + '</strong> - ' + data.city + '</p>';
}
},
source: cities
}).on('typeahead:selected', function(event, datum) {
$("#supporter_city").val(datum.city);