【问题标题】:JQuery autocomplete: trigger <g:select onChange>JQuery 自动完成:触发 <g:select onChange>
【发布时间】:2012-09-19 01:52:13
【问题描述】:

众所周知,javax.swing.JComboBox 是一个下拉选择,其中包含E 元素。在设置.setEditable(true) 时,我们现在可以将JComboBox 也设置为JTextField 用于其他E 元素。

在用Google 搜索后,它返回给我们一个使用 JQuery 关于 autocomplete 提出here 的建议。自动完成功能正在处理选择,但问题出在这里,我们需要触发包含${remoteFunction}onChange 属性,以在所述${remoteFunction}update 属性上呈现特定模板。

<g:select  
  id="itemSelectId"
  onChange="${remoteFunction(
    controller:'item', action:'itemSelect',
    update:[success:'updateItemId'],
    params:'\'id=\' + escape(this.value)'"/>
<div id="updateItemId></div>

在链接上提供的&lt;script&gt; 上,我们只需将#combobox 更改为#itemSelectId

【问题讨论】:

标签: jquery-ui jquery grails selection


【解决方案1】:

查看select2,该库可能会提供您正在寻找的功能。

【讨论】:

    猜你喜欢
    • 2012-11-16
    • 1970-01-01
    • 2012-11-21
    • 1970-01-01
    • 2015-05-15
    • 2018-01-16
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多