Syntax for multiple params in onclick remoteFunction in Grails
我有这样的代码:
1 2 3 | <button id="save" onclick ="${remoteFunction(controller: 'customer', action: 'saveModifiedIndividualRecord', params: '\'yellowIssuesRemoved=\' + removedYellowIssues')}"> Save </button> |
我想在上面的代码中添加更多参数:
1 2 3 | uniqueId: uniqueId, secondaryId: secondaryId, redIssuesRemoved: removedRedIssues |
但我无法完全理解语法,因为我之前没有使用上述技术完成多个参数。
编辑:我认为使用这种技术可以使用某种分隔符来分隔多个参数,但似乎找不到它的示例。或者记住它。
只是尝试了一些变体,但没有运气:
1 2 3 | <button id="save" onclick ="${remoteFunction(controller: 'customer', action: 'saveModifiedIndividualRecord', params: '\'redIssuesRemoved=\' + removedRedIssues' + '\'&yellowIssuesRemoved=\' + removedYellowIssues')}"> Save </button> |
1 2 3 4 5 6 7 | <button id="save" onclick ="${remoteFunction( controller: 'customer', action: 'saveModifiedIndividualRecord', params: '\'redIssuesRemoved=\' + removedRedIssues + \'&yellowIssuesRemoved=\' + removedYellowIssues')}"> Save </button> |
标记在
您也可以尝试使用地图符号代替参数的请求参数。喜欢
1 | params: [redIssuesRemoved: removedRedIssues, yellowIssuesRemoved: removedYellowIssues] |