3

I am using EasyAutocomplete plugin to auto complete search box, plugin works fine, when I search for only one type. I mean I have only one option to search, while I want that I can search with multiple values, i.e. by name, or last name etc..

here is my code:

var options = {
        url: "https://coincap.io/front",

        getValue: "long",

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

        list: {
            match: {
                enabled: true
            },

        },

        theme: "plate-dark"
    };

    $("#searching").easyAutocomplete(options);

now this is api from where I get values of crypto currencies and currently I am searching with its long name and it works fine, but I want to search with also short name.

sorry for my bad english.. I hope you got my problem. thanks

1 Answer 1

6

This plugin allows to use functions, and through functions you can do this.

var options = {
    url: "https://coincap.io/front",

    getValue: function(element){
                 return element.long+" - "+element.short;
              },
   /*
    template: {
        type: "description",
        fields: {
            description: "short"
        } 
    }, */

    list: {
        match: {
            enabled: true
        },

    },

    theme: "plate-dark"
};

$("#searching").easyAutocomplete(options);
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.