jquery - Grails 多个 JQgrid

标签 jquery json grails jqgrid

我有这个 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/

相关文章:

javascript - 如何在不刷新的情况下通知数据发生变化?

ajax - 从各种来源返回相同的JSON记录列表

grails - 如何在 Geb grails 中设置和拆卸功能测试数据

javascript - 尝试通过 crunchbase API 提取 JSON 数据。我究竟做错了什么?

python - python中使用YAML时的未知转义字符问题

java - 如何在 Grails 或 Hibernate 中缩短它

javascript - 滚动到 anchor 不可预测

javascript - Jquery UI 可排序不起作用

javascript - JS 中的等号表达式无法按预期工作

java - Json整数值自动转换为字符串值