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

#6743 aperta il 8 giu 2018

Vedi su GitHub
 (0 commenti) (0 reazioni) (0 assegnatari)JavaScript (2496 fork)batch import
help wantedneeds: analysis

Metriche repository

Star
 (5395 star)
Metriche merge PR
 (Nessuna PR mergiata in 30 g)

Descrizione

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.

Guida contributor