1

I have a editable angular-ui-grid, where my editable column in columnDefs object is defined as

columnDefs: [ {   
                name: "rightslist",
                displayNameKey: tr.rightsList,
                editableCellTemplate: 'ui-grid/dropdownEditor',
                editDropdownOptionsArray: [{name: 'Read-Only', value: 1}, {name: 'Read-Write', value: 2}],
                editDropdownIdLabel: 'value',
                editDropdownValueLabel: 'name',           
                enableCellEdit: true
            }]

The drop-down shows just fine showing me "Read-Only" and "Read-Write", but when it is closed, in the grid I see not the "name" but "value" (1 or 2).

In ui-grid example here display of cell is implemented using a filer that turns such value to a text. Is there any simpler way to tell "show me name, not value when cell is not being edited" ?

Simson
  • 3,373
  • 2
  • 24
  • 38
onkami
  • 8,791
  • 17
  • 90
  • 176

1 Answers1

1

Since you don't want a filter, I assume the text is in the model field. If that is the case then I can think of two solutions.

  1. Replace the "value: 1" with "value: 'Read-Only'" or
  2. Change editDropdownIdLabel to 'name'

I know 1 works - I haven't tried 2.

Martin Horton
  • 822
  • 3
  • 10
  • 19
  • DId it fix the issue for you. Not working for me though. I can see name in normal grid. but in edit mode nothing appears in dropdown – Saurabh Tiwari Sep 25 '16 at 06:23
  • Have a look here `http://stackoverflow.com/questions/39683921/why-am-i-not-getting-any-values-displayed-in-my-ui-grid-dropdown` – Saurabh Tiwari Sep 25 '16 at 06:24