grails - JQuery Autocomplete from DB -


I am fully implementing my fields in my fields in most of my farms in my fields.

Currently I have this code (below) which gives me the input value manually, which will be suggested to type the user, in this example I have two auto-complete values ​​for two fields Has been filled in:

  & lt; Link rel = "stylesheet" href = "http://code.jquery.com/ui/1.10.3/themes/smoothness/jquery-ui.css" /> & Lt; Script src = "http://code.jquery.com/jquery-1.9.1.js" & gt; & Lt; / Script & gt; & Lt; Script src = "http://code.jquery.com/ui/1.10.3/jquery-ui.js" & gt; & Lt; / Script & gt; & Lt; Script & gt; $ (Function () ($ {"(# source: [" "hello", "mooj"]} $ ("#defaultValue"). Autocomplete ({source: ["Blah", "Bleh"]} );});  

I have a question, what do I need to change so that instead of manually entering the values,

Any help will be appreciated.

Update:

Update:

Update:

Update: / P>

The function is in Form.gsp:

  $ {function () {$ ("#parameterName"). Autocomplete ({source: '$ {g.create link (Controller:' templateInput ', Action:' Recommended ParameterNames  

I have work in templateInput for my controller:

  The Define Suggestion parameter is named  

.

  def getSuggestedParamNameValues ​​() {def sql = new sql (dataSource) def line = sql.rows ("I know that when I If I type in the field, it returns every value in the column I  

I have the problem now. I want it so much that if I type into the word 'card' it only suggests the values ​​starting with the word 'card'.

Any thoughts?

  & lt; Input type = "text" name = "country" id = "auto-complete" />  

Ajax lookup:

  $ ('#autocomplete'). Autocomplete ({serviceUrl: '/ autocomplete / country', select: Function (Suggestion) {Warning ('You chose:' + suggestion.value + ',' + suggestion.data);}}});  

In the case of your case instead of hard work, the list of suggestions, you should use the g.createLink tag, e.g.

  serviceUrl: '$ {g.create link (administrator: "autocomplete", verb: "country")},  

Comments