【问题标题】:jquery easyui data grid editor for combo box not loading with grails用于组合框的 jquery easyui 数据网格编辑器未使用 grails 加载
【发布时间】:2014-08-28 08:04:32
【问题描述】:

我正在使用带有 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 来引用控制器中的一个操作,但它不起作用。所以为了使它与 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 编辑器的新手。请让我知道我错在哪里并帮助我解决问题。

【问题讨论】:

    标签: grails datagrid combobox editor jquery-easyui


    【解决方案1】:

    我尝试重现您的错误。

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

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

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

    【讨论】:

    • 谢谢。在您进行上述更改后,它对我有用。
    猜你喜欢
    • 1970-01-01
    • 2015-04-12
    • 2013-02-11
    • 1970-01-01
    • 2013-06-07
    • 1970-01-01
    • 1970-01-01
    • 2023-03-30
    • 2011-08-13
    相关资源
    最近更新 更多