【问题标题】:formatter:'select' does not display the description of the element but rather the value of the optionformatter:'select' 不显示元素的描述,而是显示选项的值
【发布时间】:2019-07-08 18:30:55
【问题描述】:

使用免费的 JqGrid,我通过 jquery ajax 调用加载 editOptions,我还有一个元素的 jsonMap,现在使用 formatter:'select' 时,它不显示选项的描述,而是显示值

我已经尝试构建格式化程序,下拉显示但没有选定的值

{

                    name:'position_code',
                    index:'position_code',
                    sortable: true,
                    sorttype:'text',
                    width:200,
                    editable: true,
                    edittype:"select",
                    editoptions:{
                        value: function(){ 
                            return buildDropDown(drpPosition,"");
                        }

                    },
                    formatter:'Select',
                    /* 
                     formatter:function(){ 
                            return "<SELECT>"+buildOptions(drpPosition,"")+"</SELECT>";
                    }, 
                    formatoptions: {disabled : false}, */

                    jsonmap:function(row){
                                return row["position_code"].val;
                    }
                },

让我们说一下 buildDropDown(drpPosition,""); 的值返回“1:一,2:二,3:三”等

以及行的值["position_code"].val = 2

我希望它在网格上显示两个,但它显示了 2

【问题讨论】:

  • @Oleg 你能帮忙吗?

标签: free-jqgrid


【解决方案1】:

JavaScript 中的代码区分大小写。 你已经输入了代码

formatter : 'Select',

这是不正确的。应该是:

formatter : 'select',

希望它能解决你的问题

【讨论】:

猜你喜欢
  • 2018-12-17
  • 2018-12-15
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2018-11-15
  • 1970-01-01
相关资源
最近更新 更多