保存后jqgrid不显示选项文本

问题描述 投票:0回答:1

我在jqgrid中有3个可编辑的下拉列,动态填充2个下拉列表。因为这些下拉列表的值取决于首先选择。选择行后,网格行将变为可编辑状态,并且配置为在用户单击输入后更新值。问题是在保存行之后,下拉列3和4未显示网格中的选定文本。细胞是空的。

这是两列的设置方式

            {
                name: "FirstDrop", index: "FirstDrop", width: 180, align: "left", editable: true, formatter: 'select', edittype: "select", editoptions: {
                    value:"0:select;1:first,2:second", valuesToSelect: "0"
                    , dataEvents: [
                        {
                            type: 'change',
                            fn: function (e) {
                                 //function that reload SecDrop based on value selected in this
                            }
                        }
                    ]
                }
            },
                {
                    name: "SecDrop", index: "SecDrop", width: 180, align: "left", editable: true, edittype:'select', formatter: 'select', editoptions: {
                        dataInit: function (elem) {
                           // function that appends options to "elem"
                           //$(elem).val(""); Select initial value here
                        }
                    }
                }

所以现在,当我在第一个下拉列表中更改选择时,第二个下拉列表将重新加载新值。在第二个下拉列表中选择新值后,保存后,该列为空。相反,它应显示所选选项的文本值。

当我遍历所有行时,我得到第二列的值。

不知道我在这里缺少什么。任何建议,缺少的东西,可以使用自定义格式选项实现相同的结果。

jqgrid jqgrid-asp.net jqgrid-formatter
1个回答
0
投票

不确定这是否是jqgrid v.4.7中的已知问题但是我想出了一个hack,现在处理aftersave函数以获取所选选项的值并从源json检索其相应的文本并将其分配给单元格。

© www.soinside.com 2019 - 2024. All rights reserved.