easyui datagrid 的formatter editor combobox

easyui数据表格中角色列editor为combobox,但我导入的url中的field是role_id,combobox的为editor:{type:'combobo... easyui数据表格中角色列editor为combobox,但我导入的url中的field是role_id,combobox的为
editor:{
type:'combobox',
options:{
url:'RoleComboboxServlet',
valueField:'role_id',
textField:'role_name',
required:true
}
能否仿照下面的代码写一个formatter使得表格角色列开始就是role_name
{field:'productid',title:'Product',width:100,
formatter:function(value){
for(var i=0; i<products.length; i++){
if (products[i].productid == value) return products[i].name;
}
return value;
},
editor:{
type:'combobox',
options:{
valueField:'productid',
textField:'name',
data:products,
required:true
}
}
combobox的URL与datagrid 的url不是同一个
展开
 我来答
诺记美利达
电脑发烧友

2014-07-04 · 不会修电脑,但是你问我的我都知道
知道大有可为答主
回答量:1.3万
采纳率:59%
帮助的人:3599万
展开全部
没看懂你说的什么意思。
已赞过 已踩过<
你对这个回答的评价是?
评论 收起
收起 1条折叠回答
推荐律师服务: 若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询

为你推荐:

下载百度知道APP,抢鲜体验
使用百度知道APP,立即抢鲜体验。你的手机镜头里或许有别人想知道的答案。
扫描二维码下载
×

类别

我们会通过消息、邮箱等方式尽快将举报结果通知您。

说明

0/200

提交
取消

辅 助

模 式