【发布时间】:2012-03-27 04:47:35
【问题描述】:
如何将调用从 Javascript 方法映射到 Grails 控制器?我看到一个使用 PHP 的方法,但没有使用 grails:
function getSelected(checkList)
{
var idList = new Array();
var loopCounter = 0;
//find all the checked checkboxes
jQuery("input[name=" + checkList + "]:checked").each
(
function()
{
//fill the array with the values
idList[loopCounter] = jQuery(this).val();
loopCounter += 1;
}
);
//call here
}
编辑:
${remoteFunction(controller:"person", action:"runThroughAll", params:"[ids:idList]")}
【问题讨论】:
-
Ryan - 您是否尝试对 grails 控制器进行 Ajax 调用?
-
是的 - 最后,我想做一个控制器方法调用,使用 IdList 从 JS 方法呈现模板。
标签: javascript jquery grails controller