为什么我的 ui-grid 下拉菜单中没有显示任何值? [英] Why am I not getting any values displayed in my ui-grid dropdown?

查看:18
本文介绍了为什么我的 ui-grid 下拉菜单中没有显示任何值?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有以下用于 ui-grid 列定义的代码:

I have this following code for ui-grid column Definition:

{ name: "carrier_influence_group", displayName: "Carrier influence group", enableCellEdit: true, showSortMenu: false,
                editableCellTemplate: 'ui-grid/dropdownEditor', editDropDownOptionsArray: [ { id: 11, value: 'Medium' }, { id: 12, value: 'Large' }],
                    editDropdownIdLabel: 'id',editDropdownValueLabel: 'name'}

我正在将这些对象的名称绑定到列.

I am binding the name of these object to the column.

一切正常.这样的网格正确呈现.但是当我 dbl 单击以编辑该行时,该行中的文本消失了.出现一个下拉菜单,但没有可供选择的选项.我尝试将数组更改为:

Every thing is fine normally. The grid as such renders correctly. But when I dbl click to edit this row, the text in this row disappears. A dropdown appears but it has no option to select from. I tried changing my array to:

[ { id: 11, name: 'Medium' }, { id: 12, name: 'Large' }]

这里缺少什么.我看过这个官方代码.除了过滤器外,似乎所有内容都相似.我不需要任何这样的过滤器.有没有必要拥有.官方文档没有提及任何相关内容.

What is missing here. I have seen this official code. Seems like all is similar except for a filter. I do not need any such filter. Is it necessary to have one. The official docs do not mention anything about it.

已引用http://stackoverflow.com/questions/28323540/showing-readable-data-in-ui-grid-with-editable-drop-down-cell

推荐答案

首先要尝试 - 它应该是 editDropdownOptionsArray 而不是 editDropDownOptionsArray(注意大小写).

First thing to try - it should be editDropdownOptionsArray not editDropDownOptionsArray (note the case).

这篇关于为什么我的 ui-grid 下拉菜单中没有显示任何值?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆