为什么我的ui-grid下拉列表中没有显示任何值? [英] Why am I not getting any values displayed in my ui-grid dropdown?
问题描述
对于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屋!