Denglo / bs5-autocomplete-vanillaJS

Autocomplete functionality for input fields in Vanilla Javascript based on Bootstrap classes
MIT License
10 stars 3 forks source link

no way to add external data source.. so .. #2

Open alonsohdez opened 2 years ago

alonsohdez commented 2 years ago

I add

field.addEventListener('keyup', (e) => {
    if (e.keyCode != 27 && e.keyCode != 40 && this.options.source != "") {
        var obj = this; //keep reference;
        $.get(this.options.source + $(this.field).val())
            .done(function (response) {
                obj.setData(response);
            });

      }
});

to your constructor class.

Denglo commented 1 year ago

Thanks for your comments,

 

 

BR

 

Denglo

   

Gesendet: Dienstag, 17. Mai 2022 um 08:01 Uhr Von: "alonsohdez" @.> An: "Denglo/bs5-autocomplete-vanillaJS" @.> Cc: "Subscribed" @.***> Betreff: [Denglo/bs5-autocomplete-vanillaJS] no way to add external data source.. so .. (Issue #2)

 

I add

field.addEventListener('keyup', (e) => { if (e.keyCode != 27 && e.keyCode != 40 && this.options.source != "") { var obj = this; //keep reference; $.get(this.options.source + $(this.field).val()) .done(function (response) { obj.setData(response); });

  }

});

to your constructor class.

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you are subscribed to this thread.Message ID: @.***>