easyui datagrid种编辑器combobox选择的值不显示解决方案
2024-09-29 23:47:27
var combobox_json = [{
"combobox_value" : "GDLB01",
"combobox_name" : "选项1"
}, {
"combobox_value" : "GDLB02",
"combobox_name" : "选项1"
}, {
"combobox_value" : "GDLB03",
"combobox_name" : "选项3"
}, {
"combobox_value" : "GDLB04",
"combobox_name" : "选项4"
}, {
"combobox_value" : "GDLB05",
"combobox_name" : "选项5"
}
]; $("#dg1").datagrid({
idField : "id",
//fitColumns: true,
data : [{
"id" : "id1",
"combobox_value" : "GDLB011",
"combobox_name" : "选项1"
}, {
"id" : "id2",
"combobox_value" : "GDLB012",
"combobox_name" : "选项2"
}, {
"id" : "id3",
"combobox_value" : "GDLB013",
"combobox_name" : "选项3"
}, {
"id" : "id4",
"combobox_value" : "GDLB014",
"combobox_name" : "选项4"
}, {
"id" : "id5",
"combobox_value" : "GDLB015",
"combobox_name" : "选项5"
}
],
queryParams : {},
columns : [[{
field : 'combobox_value',
title : '工段',
width : 150,
editor : {
type : 'combobox',
options : {
valueField : "combobox_value",
textField : "combobox_name",
data : combobox_json }
},
formatter : function (value, row, index) {
for (var i = 0; i < combobox_json.length; i++) {
if (combobox_json[i].combobox_value == value) {
return combobox_json[i].combobox_name;
}
}
return row["combobox_name"];
}
}
]]
});
技术交流QQ群:15129679
最新文章
- freeswitch对接其它SIP设备
- Sharepoint学习笔记—习题系列--70-576习题解析 -(Q102-Q104)
- Webpack使用教程一
- Scala 深入浅出实战经典 第55讲:Scala中Infix Type实战详解
- ionic ngcordova map 地圖
- 前端H5开发工具 Adobe Edge
- PC软件-实用工具 True Launch Bar
- [HDU 5029] Relief grain
- shell入门之expr的使用 分类: 学习笔记 linux ubuntu 2015-07-10 14:59 76人阅读 评论(1) 收藏
- PHP Curl CURLOPT_POSTFIELDS 1024
- perl 爬虫两个技巧
- UVa 10427 - Naughty Sleepy Boys
- SQL菜鸟学习札记(一)
- linux segmentation fault记录
- cordova文件系统插件的使用方法:cordova-plugin-file
- Java 简单的登录验证码
- vuex实现原理
- DMA与cache一致性的问题
- 变量 var &;函数new
- 使用LTP套件对Linux系统进行压力测试