Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dynamic auto complete #1904

Open
mohash25 opened this issue May 6, 2023 · 1 comment
Open

dynamic auto complete #1904

mohash25 opened this issue May 6, 2023 · 1 comment

Comments

@mohash25
Copy link

mohash25 commented May 6, 2023

my problem is after each API call when new data arrives and i update the autocomplete list new suggestions wont refresh.
is there a way after updating autocomplete list new information showing up?

@TorakikiSan
Copy link

  $(document).on("change", "#FIELD", function(e) {
    e.preventDefault();

    $.get("/ajax.url.php", {
       value: $("#FIELD").val()
      }).then(
         function(response) {
           Metro.getPlugin("#NEW_FIELD", "input").setAutocompleteList(response);
          },
        function(xhr){
          console.log(xhr.status, xhr.statusText);
       });

    });

Work for me!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants