grails - 用于组合框的jQuery easyui数据网格编辑器未随grails一起加载

标签 grails datagrid combobox editor jquery-easyui

我使用带有grails的Jquery Easyui Datagrid,这是我在GSP文件中创建网格的代码:-

<table class="easyui-datagrid"
         data-options="fit:true,idField:'id',pageNmber:1,pageList:[25,50,75,100]"              pagination="true" id="importGrid">
    <thead>
      <tr>
       <th data-options="field:'firstName',sortable:true,width:15,nowrap:true" >First Name</th>
        <th data-options="field:'lastName',sortable:true,width:25,nowrap:true" editor="{type:'validatebox',options:{required:true}}" >Last Name</th>
        <th data-options="field: 'firstNameLastName',sortable:true,width:130,nowrap:true" >First Name Last Name</th>
        <th data-options="field:'displayName',sortable:true,rowspan:2,width:80,nowrap:true">Display Name</th>
        <th data-options="field:'relocation',sortable:true,width:130,nowrap:true">Relocation</th>
        <th data-options="field:'proficiency',sortable:true,width:130,nowrap:true" editor="{
                type:'combobox',
                options:{
                    valueField:'rightid',
                    textField:'rightname',
                    data:aRights,
                    required:true
                }
            }">Proficiency</th>
        <th data-options="field:'subProficiency',sortable:true,width:130,nowrap:true" editor='proficiencyEditor'>Sub Proficiency</th>
        <th data-options="field:'uploadResume',sortable:true,width:130,nowrap:true,">Relocation</th>
      </tr>
    </thead>
  </table>

我尝试使用url引用 Controller 中的一个 Action ,但是它不起作用。所以现在使其与gsp一起使用,我正在使用我在同一gsp中声明的js变量。我有这样的变量aRights:-
<script> var aRights =  [{rightid: 'V', rightname: 'View Only'},
                                {rightid: 'E', rightname: 'Edit FPC'},
                                {rightid: 'A',  rightname: 'Admin'},
                                {rightid: 'N', rightname: 'None'}
                ] ;
</script>

但是编辑器是永远不可见的。

这是我用来填充数据网格的代码。此代码在js中:
  $('#importGrid').datagrid({
    url:'/'+productName+'/TestList/excelImport',
             queryParams:{
        list: hiddenMapForFields,
        file:fileName            
    },
    pageNumber: 1,
   });

我是Jquery easyui编辑器的新手。请告诉我我错了,并帮助我解决问题。

最佳答案

我尝试重现您的错误。

http://jsfiddle.net/niscio/63fyrzL8/1/

如果您阅读文档,则真正的编辑问题是必须使用edatagrid声明

 $('#ID').edatagrid({... options ...});

关于grails - 用于组合框的jQuery easyui数据网格编辑器未随grails一起加载,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25543772/

相关文章:

grails - Grails WAR文件是否需要grails-app views文件夹?

java - Grails 3.0.2 缺少生成 View

c# - WPF DataGrid 通过绑定(bind)设置样式

c# - 在 C# wpf 项目中以编程方式将图像添加到 DataGrid - 如何?

combobox - 网格中的 Extjs4 组合框 displayValue

grails - Grails创建多个值(value)图

Excel将我的数字变成 float

wpf 组合框项目源 Collection View 源与直接绑定(bind)

java - 如何让不可编辑的ComboBox显示提示文本?

Grails - Acegi : Customize Authentication Method