angular-ui/ui-grid

when using editDropdownRowEntityOptionsArrayPath you MUST declare the editableCellTemplate prior to editDropdownLabel or you get undefined in the dropdown for the options

已關閉

#6,743 建立於 2018年6月8日

 (0 則留言) (0 個反應) (0 位負責人)JavaScript (2,496 個分叉)batch import
help wantedneeds: analysis

倉庫指標

星標
 (5,395 顆星)
PR 合併指標
 (PR 指標待抓取)

描述

Normally when using a dropdown, it doesn't matter what order you put the items in the column definition object. I don't know if it is a bug or not, but it should at least be documented that if you do not go in this order when using editDropdownRowEntityOptionsArrayPath:

editableCellTemplate: 'ui-grid/dropdownEditor', editDropdownValueLabel: 'rout', editDropdownRowEntityOptionsArrayPath: 'routingNumber'}

you will get all undefined options in your select dropdown(although as soon as you select an option and exit it will display the correct one).

I spent about 6 hours trying to figure out why this was happening because I initially had it declared as this:

editDropdownValueLabel: 'rout', editableCellTemplate: 'ui-grid/dropdownEditor', editDropdownRowEntityOptionsArrayPath: 'routingNumber'}

which works perfectly fine when declaring a normal array in the editDropdownOptionsArray.

Please either fix this so order doesn't matter or at least put documentation that this is the case so other people are not spending numerous hours chasing down a bug that is a little crazy.

貢獻者指南