Easyui datagrid 编辑结束时combobox显示value而不显示text

简介: Easyui datagrid 编辑结束时combobox显示value而不显示text
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"];
                }
var combobox_json= "";
function GetLevelDTAJ() {
    $.ajax({
        url: "xx",
        type: 'get',
        async: false,//此处必须是同步
        dataTye: 'json',
        success: function (data) {
            combobox_json= data;
        }
    })
    return combobox_json;
}
  • formatter方法:
formatter: function(row){
        var opts = $(this).combobox('options');
        return row[opts.textField];
}


相关文章
|
3天前
EasyUI datagrid 从左至右递归合并表格
EasyUI datagrid 从左至右递归合并表格
16 2
|
3天前
EasyUI DataGrid 假分页
EasyUI DataGrid 假分页
21 0
Easyui combobox 取值赋值解答
Easyui combobox 取值赋值解答
|
3天前
|
JavaScript
EasyUi js 加载数据进下拉框combobox
EasyUi js 加载数据进下拉框combobox
|
3天前
|
JavaScript 前端开发
EasyUi js 加载数据表格DataGrid
EasyUi js 加载数据表格DataGrid
|
3天前
|
前端开发
easyui datagrid 的 tip实现
easyui datagrid 的 tip实现
|
3天前
|
JSON 监控 数据格式
Easy UI datagrid的学习
Easy UI datagrid的学习