I have this Grails application wherein I installed JQuery, JQuery-UI, and JQGrid plugin.
I have this GSP wherein I need to display multiple JQGrid.
Here’s the sample script of the page.
<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>
And here’s the wrapper on the inside the body tag
<p>Type 1</p>
<jqgrid:wrapper id="type1List" />
<p>Type 3</p>
<jqgrid:wrapper id="type3List" />
And the DraftController where both jqgrid are referred from contains two methods: listType1() and listType3(). Both of the methods have this ending statement, render jsonData as JSON where the jsonData follow the format presented here.
Unfortunately, I can’t display both JQGrid properly. I can only display the type1List having to remove the codes concerning the type3List. How can I display both JQGrids properly after the document is ready or have loaded?
Thanks.
I think you would benefit from leaving the plugin alone and using the jqgrid directly. It’s really just as easy as learning to use the plugin tags and will make your life much easier in the long run if you start wanting to do more complex tasks with the grid.
Check the Grails & JQGrid tutorial I wrote to see what I mean : http://www.grailsforum.co.uk/showthread.php/3-Grails-jQuery-amp-the-jQuery-Grid-Part-One