[ASK] Integrating CI and Jquery autocomplete plugin |
[eluser]Aria Rajasa[/eluser]
Hi all, I am trying to use the jquery autocomplete plugin and found a bit of stuck here. It seems that the plugin uses a $_GET parameter and therefore can't work with the CI URL re-routing. It calls url like this: http://localhost/SITE/controller/search_...9101506002 I can't get the variable q to work, but if I can rewrite the url to let's say: http://localhost/QMIT/plan/search_fullname/joko then I can just adjust the controller to work accordingly, any hints? TIA
[eluser]Aria Rajasa[/eluser]
Thank you so much <b>gon</b> for the reply. I use your solution and change it to post and now it works! Thanks again!
[eluser]San2k[/eluser]
Hi! I started to work with CI yesterday. Could you please write a little example of how did you realized this autocomplete feature in CI? Here where iam stuck - $("#suggest1").autocomplete('/data_work/search_username/',type:"post"); }); So data_work is a cntroller. search_username - function. This function will search for usernames in DB and return it to autocomplete. I dont know what to do next. I think its necessarily to do something with CI URI routing, but i dont know what exactly
[eluser]Aria Rajasa[/eluser]
I am using the jquery autocomplete and edit the jquery.autocomplete.js. I search for: Code: $.ajax({type: "get"... and edit the "get" to "post", and it works! I also encountered another problem with thickbox. So I used the "activating the get functionality" that was also recommended and it also works Hope it helps
[eluser]GrootBaas[/eluser]
Hi all, I seem to have the same issue, but I can not find Code: $.ajax({type: "get" Please can someone help me in the right direction. Thanks in advance,
[eluser]Aria Rajasa[/eluser]
search for Code: $.ajax({mode: "abort",port: "autocomplete" + input.name, and add type: "post" like this Code: $.ajax({type: "post", mode: "abort",port: "autocomplete" + input.name, Works for me
[eluser]GrootBaas[/eluser]
Guys, Thank you so much for your help. You really make a difference in somebody's live with the fast and educated replies. Thank you all again. For the next person who comes across this problem ... Inside jquery.autocomplete.js Change Code: $.ajax({mode: "abort", to this ... Code: $.ajax({type: "post", Then in your controller, change .... Code: $q = strtolower($_GET["q"]); Code: $q = strtolower($_POST["q"]);
[eluser]mikeyhell[/eluser]
Adding type: "post", in jquery.autocomplete.js throws an error: missing } in compound statement Anyone know why? This seemed to work before and my JS skills aren't good enough to track it down. Thanks |
Welcome Guest, Not a member yet? Register Sign In |