ui-grid icon indicating copy to clipboard operation
ui-grid copied to clipboard

Pass Object to SelectOptions

Open euvin3582 opened this issue 10 years ago • 2 comments

I have the following object gridData.SupplierName = [{'a', 'b', 'c'}];

I want to pass this object into

{ name: 'Supplier', field: 'SupplierName', enableCellEdit: false, allowCellFocus: false, filter: { term: '', selectOptions: gridData.Subject, type: uiGridConstants.filter.SELECT } },

But when I do this I get tons of undefined objects in the select combobox. Is there a way in which I can do something like a key/value pair from that object or an object I can pass to the grid to make it display key/value correctly.

Thank you.

euvin3582 avatar Feb 17 '16 19:02 euvin3582

i believe you need to provide gridData.Subject in this format: selectOptions: [ { value: 1, label: 'male' }, { value: 2, label: 'female' } ]

value and label, so grid will understand ur datasource for combobox display.

tringuyenminh92 avatar Feb 28 '16 16:02 tringuyenminh92

Please use stack overflow and gitter for questions in future. Also check tutorials.

jmalkan avatar Apr 28 '18 23:04 jmalkan