[add] Bloodhound in local files
This commit is contained in:
parent
49e114c18a
commit
6615e5471a
@ -226,7 +226,7 @@ if(!isset($_SESSION['userName'])){
|
|||||||
<script src="../js/getBaseUrl.js"></script>
|
<script src="../js/getBaseUrl.js"></script>
|
||||||
<script src="../js/landing.js"></script>
|
<script src="../js/landing.js"></script>
|
||||||
<script src="../js/bootstrap-datepicker.min.js"></script>
|
<script src="../js/bootstrap-datepicker.min.js"></script>
|
||||||
<script src="https://twitter.github.io/typeahead.js/releases/latest/typeahead.bundle.js"></script>
|
<script src="../js/typeahead.bundle.js"></script>
|
||||||
|
|
||||||
<link href="../css/bootstrap-datepicker.min.css" rel="stylesheet">
|
<link href="../css/bootstrap-datepicker.min.css" rel="stylesheet">
|
||||||
<link href="../css/landing.css" rel="stylesheet">
|
<link href="../css/landing.css" rel="stylesheet">
|
||||||
|
@ -4,7 +4,8 @@
|
|||||||
$(document).ready(function(){
|
$(document).ready(function(){
|
||||||
let baseUrl = getbaseUrl();
|
let baseUrl = getbaseUrl();
|
||||||
|
|
||||||
let productos = new Bloodhound({
|
// Setting up bloodhound typeahead
|
||||||
|
let employeesList = new Bloodhound({
|
||||||
datumTokenizer: Bloodhound.tokenizers.obj.whitespace("name"),
|
datumTokenizer: Bloodhound.tokenizers.obj.whitespace("name"),
|
||||||
queryTokenizer: Bloodhound.tokenizers.whitespace,
|
queryTokenizer: Bloodhound.tokenizers.whitespace,
|
||||||
remote: {
|
remote: {
|
||||||
@ -23,8 +24,7 @@ $(document).ready(function(){
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
// Initialize the Bloodhound suggestion engine
|
employeesList.initialize();
|
||||||
productos.initialize();
|
|
||||||
|
|
||||||
$("#editEmploySearch").typeahead({
|
$("#editEmploySearch").typeahead({
|
||||||
hint: true,
|
hint: true,
|
||||||
@ -34,7 +34,7 @@ $(document).ready(function(){
|
|||||||
{
|
{
|
||||||
name: "result",
|
name: "result",
|
||||||
displayKey: "fullName",
|
displayKey: "fullName",
|
||||||
source: productos.ttAdapter()
|
source: employeesList.ttAdapter()
|
||||||
}).bind("typeahead:selected", function(obj, datum, name) {
|
}).bind("typeahead:selected", function(obj, datum, name) {
|
||||||
$(this).data("id", datum.code);
|
$(this).data("id", datum.code);
|
||||||
console.log(datum.code);
|
console.log(datum.code);
|
||||||
|
2451
api-payroll/public/js/typeahead.bundle.js
Normal file
2451
api-payroll/public/js/typeahead.bundle.js
Normal file
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue
Block a user