我使用带有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/