通我有一个Grails与此 选定的jqGrid行按钮与动作
<script type="text/javascript">
/* when the page has finished loading.. execute the follow */
$(document).ready(function() {
jQuery("#customer_list").jqGrid({
url:'jq_customer_list',
datatype: "json",
colNames:['customer','location','id'],
colModel:[
{name:'customer'},
{name:'location',stype:'select', searchoptions:{value:':All;USA:USA;Canada:Canada;Carribean:Carribean;USPacific:USPacific;'}},
{name:'id', hidden:true}
],
rowNum:2,
rowList:[1,2,3,4],
pager: jQuery('#customer_list_pager'),
viewrecords: true,
gridview: true,
multiselect: true
});
$("#customer_list").jqGrid('filterToolbar',{autosearch:true});
});
</script>
<g:link controller="MyController" action="downloadFile">Download</g:link><br>
</div>
<br/><br/>
查看现在我想从所选行进入该操作中的数据。但是,我无法在任何地方找到它。
我的控制器上的方法目前是空白的。我只想打印到控制台所有选定值的ID。
有什么建议吗?谢谢
创建一个隐藏的输入来存储值。无论输入的名称是什么,都是您在控制器中引用它的内容。 'params.name' –
这个相关的文章应该让你去[jqGrid:传递选定的ID作为HTML表单参数](http://stackoverflow.com/questions/7836192/jqgrid-pass-selected-ids-as-html-form -parameters) – uchamp