【发布时间】: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