【问题标题】:richui autocomplete working with firebug onlyRichui 自动完成功能仅与 firebug 一起使用
【发布时间】:2013-04-09 02:00:37
【问题描述】:

我正在使用 grails 2.1.0 和 grails richui 插件 8.0 进行自动完成。 我的问题是如果萤火虫在 Firefox 中打开,则自动完成工作。在其他浏览器中它不起作用。但是 ajax 调用将转到后端,因为我能够打印结果。 以下是我在头标签中的 gsp 中的代码

 <resource:include components="autoComplete" autoComplete="[skin:'default']"/>

自动完成

 <richui:autoComplete name="searchCountry" id="searchCountry" delimChar=","  class="countryBox" action="${createLinkTo('dir': 'controller/getCountryList')}"/></td>

这是我控制器中的代码

  def getCountryList()
    {
    println("**********get country list*********")
    def locations = Countrylist.findAllByCityLike("%${params.query.trim()}%")

    render(contentType: "text/xml"){
        results()
        {
            locations.each { location -> result(){
                    name(location.city + ", " + location.state)
                    println("**********get country list*********"+location.city + ", " + location.state)
                }
            }
        }
    }

}

感谢您的帮助和建议。

【问题讨论】:

  • javascript 控制台有错误吗?还要检查任何 console.log() 语句 - 我已经看到它们在某些浏览器上失败。还请提供它们不工作的浏览器版本。
  • 很抱歉这么晚才回复,没有控制台没有错误,并且在我在 ie8、ie9 和 FF(19) 中测试的所有浏览器中也无法正常工作

标签: grails autocomplete rich-ui


【解决方案1】:

从控制器返回的 xml 似乎不正确。 afaik,它应该是以下格式,

<results>
    <result>
        <id>1</id>
        <name>city,state</name>
    </result>
</results>

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2013-03-14
    • 2018-04-01
    • 1970-01-01
    • 2011-09-17
    • 1970-01-01
    • 2012-05-09
    • 2022-08-15
    • 1970-01-01
    相关资源
    最近更新 更多