【发布时间】: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>
在链接上提供的<script> 上,我们只需将#combobox 更改为#itemSelectId。
【问题讨论】:
-
如何触发上述jquery-ui的
change属性内的${remoteFunction}autocomplete。 -
感谢您的建议,我们更喜欢组合框或
select,以便列表中不考虑其他E。 -
@Chronial,你能给出答案吗?
标签: jquery-ui jquery grails selection