gpt4 book ai didi

grails - 如何将groovy变量和javascript值都传递给grails Controller ?

转载 作者:行者123 更新时间:2023-12-02 14:11:40 25 4
gpt4 key购买 nike

<td><g:field type="number" name="deadlineFT" value="${selectedMilestone.deadlineFT}"
onchange="${remoteFunction(action: 'updateMilestone', params: [id: selectedMilestoneID, item:'deadlineFT', value: this.value])}"/> Months</td>
selectedMilestoneIDgroovy变量。上面的代码不起作用,因为groovy无法识别 this.value。但是,如果我使用 params: '\'value\'+this.value,则无法获取 selectedMilestoneID

是否有办法获得两个值?

最佳答案

试试这个:

<g:field type="number" name="deadlineFT" value="${selectedMilestone.deadlineFT}"
onchange="${remoteFunction(action: 'updateMilestone',
params: "'id=${selectedMilestoneID}&value='+this.value")}"/>

关于grails - 如何将groovy变量和javascript值都传递给grails Controller ?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23842339/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com