Welcome Guest, Not a member yet? Register   Sign In
autocomplete not working in ci3?
#7

If you're using jQuery UI, try:

Code:
$("#birds").autocomplete({
 source: function(request, response) {
   $.ajax({
     url: "/home/search_description",
     data: request,
     dataType: "json",
     type: "GET",
     success: function(data) {
       response(data);
     }
   });
 },
 minLength: 2,
 delay: 500
});

I took this from my currently working autocomplete code and just added in your info so adjust it as necessary. As for the console that CroNiX mentioned, open up Chrome, right click anywhere, and open up the inspector by clicking on "Inspect Element". Click on Console and you should be able see in real-time if your JS is really reaching out to your endpoint and if it's retrieving data correctly. Place console.log(data) in your JS code if you'd like to inspect your response in the console. If you're on Firefox, try the Firebug extension.
Reply


Messages In This Thread
autocomplete not working in ci3? - by jaysondotp - 02-23-2015, 12:03 AM
RE: autocomplete not working in ci3? - by CroNiX - 02-23-2015, 06:04 PM
RE: autocomplete not working in ci3? - by Nichiren - 02-25-2015, 01:33 PM



Theme © iAndrew 2016 - Forum software by © MyBB