logo
down
shadow

Tokeninput Autocomplete not working in grails


Tokeninput Autocomplete not working in grails

By : lacuna ronquillo
Date : November 22 2020, 11:05 AM
fixed the issue. Will look into that further 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: , Try this:
code :
def tags = {
    def foundTags = Tag.findAllByTagnameIlike("${params.q}%")
    def output = []
    foundTags.each {
        output.add([id: it.id, name: it.tagname]) // assumes Tag has an id field exposed
    }
    render output as JSON
}


Share : facebook icon twitter icon
Why does jquery ui dialog mangle my jquery.tokeninput.js autocomplete?

Why does jquery ui dialog mangle my jquery.tokeninput.js autocomplete?


By : Vivek Mohan
Date : March 29 2020, 07:55 AM
help you fix your problem It looks like dialog re-runs the script tags in the block of code so my autocomplete is executing twice.
my fix was to remove the script tags in the code I was dialoging
code :
$("#popup script").remove();
$("#popup").dialog({ ... });
tokeninput in rails not working

tokeninput in rails not working


By : rohit
Date : March 29 2020, 07:55 AM
like below fixes the issue ok: this is a rough but working example using jquery autocomplete
https://github.com/glennmartinez/QaBase/pull/1
code :
[
  {"id":"856","name":"House"},
  {"id":"1035","name":"Desperate Housewives"},
  ...
]
Notes.all.map { |n| {:id => n.tag, :name => n.name } }.to_json
[
  {"id":"tagname","name":"House"},
  {"id":"othertagname","name":"Desperate Housewives"},
  ...
]
jQuery Tokeninput: readonly not working

jQuery Tokeninput: readonly not working


By : arya
Date : March 29 2020, 07:55 AM
hop of those help? It turns out that the code you get from download link on the web page at http://loopj.com/jquery-tokeninput/ doesn't actually support this feature, even though it's in the documentation on the page, the download link says "latest" and the version number is the same as the latest commit in their repo.
I downloaded a newer version from their GitHub https://github.com/loopj/jquery-tokeninput and it now works fine.
TokenInput Autocomplete in RTL language

TokenInput Autocomplete in RTL language


By : Bomiheko
Date : March 29 2020, 07:55 AM
fixed the issue. Will look into that further It looks like someone may have already implemented this, and shared it on GitHub. Check out these pull requests.
https://github.com/loopj/jquery-tokeninput/pull/536/commits
Grails - jQuery UI Autocomplete not working

Grails - jQuery UI Autocomplete not working


By : Reid_461
Date : March 29 2020, 07:55 AM
With these it helps no worries added as answer. The link that worked for you was: http://ohmiserableme.blogspot.co.uk/2011/08/grails-jquery-ajax-autocomplete-with.html
Download Grails application framework for http://www.grails.org
code :
Create a domain class "City"

    package myapp
    class City {
        String city
        static constraints = {
            city nullable:false, blank:false, maxSize:200
        }
    }

create controller
grails create-controller city
edit the CityController,
import grails.converters.*
add
def ajaxCityFinder = {
   def citiesFound = City.withCriteria {
         ilike 'city', params.term + '%'
        } 
 render (citiesFound as JSON)
} 
<html>
    <head>
        <meta name="layout" content="main" />

        <link rel="stylesheet" href="${resource(dir:'css/smoothness',file:'jquery-ui-1.8.14.custom.css')}" />

        <g:javascript library="jquery.min" />
        <g:javascript library="jquery-ui-1.8.14.custom.min" />
        <g:javascript>
            $(document).ready(function() {
               $('#city').autocomplete({
                 source: '<g:createLink controller='city' action='ajaxCityFinder'/>'
               }); 

            });        
        </g:javascript>
    </head>
    <body>
        <div class="demo">
            <div class="ui-widget">
                <label for="city">City: </label>
                <input id="city">
            </div>
        </div>
    </body>
</html>
Related Posts Related Posts :
  • How do I perform a validation check to a text input using JavaScript?
  • div.style.display not working when declared inside a function
  • show Tooltip only when the ellipsis is active
  • Why my code with switch(true) and Array.concat() doesn't work properly
  • mouseleave() not deleting class
  • Cannot add class to clicked element
  • console.log show empty module
  • Is there a way to select any type of text?
  • How do I loop through multiple pages in an API?
  • Angular with ngrx - nothig happen
  • JS Map from Object.entries memory usage
  • React-Vis Legend toggle filter for line chart
  • how to set a component in react-modal?
  • How to create semicolon separated CSV in Javascript with custom file name?
  • Adding types to a recursive function
  • JavaScript: Match any element within array and return the match
  • scrollTop or scrollLeft on horizontal website?
  • Build error while creating wrapper for C++ to javascript using swig
  • ERROR in node_modules/rxjs-compat/operator/shareReplay.d.ts(2,10):
  • jQuery Script is not working after Pagination
  • Props from contextual provider: Property 'xxx' does not exist on type 'IntrinsicAttributes & InterfaceProps'
  • Setting state of an object property inside array of objects based on a computation after match : reactjs
  • Return data from joined table in Knex update
  • Why does this D3 code not produce any output in Jupyter Notebook?
  • Can't retreive my movies data after importing array function in React JS
  • Having issue with using jQuery pushy js in two menus
  • How do I scale an entire webpage for tablet screen width on load with javascript?
  • create .json file on run time in javascript and save it in the end
  • Weird error TypeError: Cannot read property 'getValue' of null
  • How to switch to a different date format?
  • Get notified when React tree is updated
  • Transform an object with an array into an array
  • How to format a Date in Javascript
  • How to apply mixpanel on event 'triggering' of dropdown in antdesign
  • Webpack bundle my js but that js wont work
  • Piping inside a subscribe in ngrx
  • Not recognized javascript function in html
  • Not able to get form element's value after submitting form using this.form.submit();
  • How to create binary to decimal in JavaScript without parseInt()
  • How to change cell background color and add text(from selected button) in full calendar Cell by Clicking Button?
  • How to flatten array with the given callback in Javascript?
  • Pulling Data off a Weather API and tweeting it
  • How to change Header in fetch request at no-cors?
  • When a button is clicked that decrements a value, how do you stop it decrementing into the negative range
  • How do I call another method from within the same class in Javascript
  • Is it possible to sort a ES6 map object for a property of its value object?
  • Unable to create a new project with the Nest CLI
  • Remove childless elements (except leafs) from nested array
  • JS: Call certain function before calling each of other functions in file
  • Run jQuery on click function but not on a child
  • Pass props to global context provider from function
  • How to update selected checkbox values in php mysql?
  • How can I write a regular expression that matches everything between the first and the last quote?
  • Render PDF from buffer using Node.js and JavaScript
  • Get column header and row header on cell click
  • JavaScript overriding href llinks
  • JQuery - Format Numbers in K,Lacs,Crore
  • SignalR join/leave group doesn't work correctly
  • Message page not found for few css and js files in Spring MVC project
  • Javascript - Onchange Event for checkbox works only in Firefox and Opera?
  • shadow
    Privacy Policy - Terms - Contact Us © festivalmusicasacra.org