EasyAutocomplete - example

JQuery autocomplete plugin.

This example shows how you can use EasyAutocomplete to create suggestions list that displays users and their email adress.




Javascript:

var options = {
    url: "resources/people.json",

    getValue: "name",

    template: {
        type: "description",
        fields: {
            description: "email"
        }
    },

    list: {
        match: {
            enabled: true
        }
    },

    theme: "plate-dark"
};

$("#example-mail").easyAutocomplete(options);

HTML:

<input id="example-mail"/>

people.json

[
  {
    "name": "Declan Haley",
    "email": "Cras.lorem.lorem@nonquam.ca"
  },
  {
    "name": "Francis Marsh",
    "email": "neque@arcu.edu"
  },
  {
    "name": "Gage Figueroa",
    "email": "Sed.auctor.odio@magnis.ca"
  },
  {
    "name": "Asher Gay",
    "email": "Phasellus@nonsapien.ca"
  },
    ...
]