我有这个 Grails 应用程序,我在其中安装了 JQuery、JQuery-UI 和 JQGrid 插件。
我有这个 GSP,我需要在其中显示多个 JQGrid。
这是页面的示例脚本。
<jq:resources />
<jqui:resources />
<jqgrid:resources />
<script type="text/javascript">
$(document).ready(function() {
<jqgrid:grid id="type1List"
url="'${createLink(action: 'listType1', controller:'draft', params:[selectionDate: selectionDate])}'"
...
datatype="'json'">
</jqgrid:grid>
<jqgrid:grid id="type3List"
url="'${createLink(action: 'listType3', controller:'draft', params:[selectionDate: selectionDate])}'"
...
datatype="'json'">
</jqgrid:grid>
});
</script>
这是body标签内部的包装
<p>Type 1</p>
<jqgrid:wrapper id="type1List" />
<p>Type 3</p>
<jqgrid:wrapper id="type3List" />
和
DraftController
其中两个 jqgrid 都被引用包含两种方法:listType1()
和 listType3()
.这两种方法都有这个结束语句,render jsonData as JSON
其中 jsonData 遵循呈现的格式 here .不幸的是,我无法正确显示两个 JQGrid。我只能显示
type1List
必须删除有关 type3List
的代码.文档准备好或加载后如何正确显示两个 JQGrid?谢谢。
最佳答案
我认为您会受益于不理会插件并直接使用 jqgrid。这真的就像学习使用插件标签一样简单,如果您开始想要使用网格执行更复杂的任务,从长远来看,这将使您的生活更加轻松。
查看我写的 Grails & JQGrid 教程,了解我的意思:http://www.grailsforum.co.uk/showthread.php/3-Grails-jQuery-amp-the-jQuery-Grid-Part-One
关于jquery - Grails 多个 JQgrid,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11115647/