We have a ListGrid with editable rows. One column needs to be editable as a selectItem. I see many examples of using optionDataSource to point to a DataSource for the list items. How an I just use an array present in the record as the valueMap? For example, if the json for the record is something like:
Interestingly, the “values” argument doesn’t contain the entire record being edited, only the first column (which in our case is a fields called ROWID). This requires the use of setSelectedRecord() to fetch the shipping methods valueset instead of being able to return values.SHIPPING_METHODS.
However, when the ListGrid is first drawn, the column contains the numeric value that comes in the record as SHIPPING_METHOD. Is there a way to apply a valuemap that’s in the record in the ListGridField directly so it maps during creation?
This causes the field to show the mapped value, but also for some reason causes the field to no longer be editable (ignores the canEdit: true).
Thanks for any insight you can provide on this one.
There are a few approaches covered in the docs for ListGridField. It looks like you may be able to just set displayField on the “SHIPPING_METHOD” field to “SHIPPING_METHODS”.