I am working on setting up JqGrid with Grails and have in-line editing working. I have a drop-down box appear when the user selects a specific cell.
I want to populate this drop-down list from a table but am having trouble connecting the pieces together. Here is the code i have so far…
$(document).ready(function() {
jQuery("#task_list").jqGrid({
...
colModel:[
{name:'foo', editable:true, edittype:'select', editOptions:{values: ${com.project.inf.Domain.list()}}},
...
The ${com.project.inf.Domain.list()} creates a list of comma-delimited items, which I want to be displayed as options in the drop-down. However, it seems editOptions only accepts name:value pairs. Is there a simple way to re-format the List() so it is accepted?
Thanks for the help!
After some experimentation and reading of tutorials, I found the solution to this problem. I had to create a custom controller action and use the “dataUrl” option to use it as follows:
With the following as the listAsSelect action in the “bar” controller: