I am having an ui-grid, one of its column having dropdown, which should be loaded from a string array like $scope.DepotNames = {'abc', 'xyz','uvw'}. These values comes from DB. All the example I have seen online used 2-d array(id and value) to load drop down. How we can use 1 dimensional array to load dropdown values in grid. I don't want to convert my data explicitly to 2-dimension.
Below is the code I found most of the place where data is in 2-dimension array
{
name: 'gender',
displayName: 'Gender',
editableCellTemplate: 'ui-grid/dropdownEditor',
width: '20%',
cellFilter: 'mapGender',
editDropdownValueLabel: 'gender',
editDropdownOptionsArray: [{
id: 'male',
gender: 'Male'
}, {
id: 'female',
gender: 'Female'
}]
But I have 1-d Array something like
{
name: 'gender',
displayName: 'Gender',
editableCellTemplate: 'ui-grid/dropdownEditor',
width: '20%',
cellFilter: 'mapGender',
editDropdownValueLabel: 'gender',
editDropdownOptionsArray: [{'Male','Female'}]
}