added template for autocomplete
This commit is contained in:
@@ -22,9 +22,14 @@ javascript:
|
|||||||
|
|
||||||
$('#supporter_city').typeahead({
|
$('#supporter_city').typeahead({
|
||||||
minLength: 2,
|
minLength: 2,
|
||||||
highlight: true,
|
|
||||||
},{
|
},{
|
||||||
display: 'city',
|
limit: 20,
|
||||||
|
display: 'city',
|
||||||
|
templates: {
|
||||||
|
suggestion: function (data) {
|
||||||
|
return '<p><strong>' + data.plz + '</strong> - ' + data.city + '</p>';
|
||||||
|
}
|
||||||
|
},
|
||||||
source: cities
|
source: cities
|
||||||
}).on('typeahead:selected', function(event, datum) {
|
}).on('typeahead:selected', function(event, datum) {
|
||||||
$("#supporter_zip").val(datum.plz);
|
$("#supporter_zip").val(datum.plz);
|
||||||
@@ -32,9 +37,14 @@ javascript:
|
|||||||
|
|
||||||
$('#supporter_zip').typeahead({
|
$('#supporter_zip').typeahead({
|
||||||
minLength: 2,
|
minLength: 2,
|
||||||
highlight: true,
|
|
||||||
},{
|
},{
|
||||||
|
limit: 20,
|
||||||
display: 'plz',
|
display: 'plz',
|
||||||
|
templates: {
|
||||||
|
suggestion: function (data) {
|
||||||
|
return '<p><strong>' + data.plz + '</strong> - ' + data.city + '</p>';
|
||||||
|
}
|
||||||
|
},
|
||||||
source: cities
|
source: cities
|
||||||
}).on('typeahead:selected', function(event, datum) {
|
}).on('typeahead:selected', function(event, datum) {
|
||||||
$("#supporter_city").val(datum.city);
|
$("#supporter_city").val(datum.city);
|
||||||
|
|||||||
Reference in New Issue
Block a user