Torna al Thread
<asp:TextBox ID="txtRicercaDove" TextMode="SingleLine" runat="server"></asp:TextBox>
<!-- Typeahead -->
<script src="/js/moduli/typeahead/typeahead.bundle.js"></script>
<script src="/js/moduli/typeahead/handlebars-v3.0.0.js"></script>
<script type="text/javascript">
var ricercaData = $(function() {
$.ajax({
url: '/Handler/myLoadData.ashx',
data: { type: 'localita' },
cache: false,
async: false,
dataType: 'json',
type: 'POST',
error: function (request, error) {
},
success: function (response) {
return response;
}
});
});
$('#<%= txtRicercaDove.ClientID %>').typeahead(null, {
displayKey: 'Localita.Default',
source: ricercaData,
templates: {
empty: [
].join('\n'),
suggestion: Handlebars.compile('<p><strong>{{Localita.Default}}</strong> – {{Provincia}}</p>')
}
});
</script>
<!-- fine Typeahead -->