activated datepicker for more input fields

added typeahead code for search query field
This commit is contained in:
steinm 2013-01-24 09:02:48 +00:00
parent 3ce0474c42
commit db6ed9497f

View File

@ -6,10 +6,10 @@ $(document).ready( function() {
$('body').on('touchstart.dropdown', '.dropdown-menu', function (e) { e.stopPropagation(); });
$('#expirationdate, #fromdate, #todate')
$('#expirationdate, #fromdate, #todate, #createstartdate, #createenddate, #expirationstartdate, #expirationenddate')
.datepicker()
.on('changeDate', function(ev){
$('#expirationdate, #fromdate, #todate').datepicker('hide');
$('#expirationdate, #fromdate, #todate, #createstartdate, #createenddate, #expirationstartdate, #expirationenddate').datepicker('hide');
});
$(".chzn-select").chosen();
@ -29,4 +29,18 @@ $(document).ready( function() {
}
}
});
/* The typeahead functionality useѕ the rest api */
$("#searchfield").typeahead({
minLength: 3,
source: function(query, process) {
$.get('../restapi/index.php/search', { query: query, limit: 8, mode: 'typeahead' }, function(data) {
process(data);
});
},
updater: function (item) {
document.location = "../op/op.Search.php?query=" + encodeURIComponent(item);
return item;
}
});
});