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

Open

#6,743 opened on 2018年6月8日

GitHub で見る
 (0 comments) (0 reactions) (0 assignees)JavaScript (2,496 forks)batch import
help wantedneeds: analysis

Repository metrics

Stars
 (5,395 stars)
PR merge metrics
 (30d に merged 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.

コントリビューターガイド