Skip to content Skip to sidebar Skip to footer

Tokeninput Autocomplete Not Working In Grails

I think this is more of a jQuery question than that of grails.I am trying to make tokeninput work with a grails form with the following input:

Solution 1:

Try this:

deftags = {
    deffoundTags = Tag.findAllByTagnameIlike("${params.q}%")
    defoutput = []
    foundTags.each {
        output.add([id: it.id, name: it.tagname]) // assumes Tag has an id field exposed
    }
    render output as JSON
}

Code not tested sorry, so may have bugs.

Post a Comment for "Tokeninput Autocomplete Not Working In Grails"