Source for combobox in grid

Hello.

How to specify source for combobox array of objects?

editorType: “combobox”, options: [{id:1, value:“Yes”}, {id:2, value:“No”}, {id:3, value:“Undefined”}] }

I need to set value for cells - 1, 2, 3 … and display text - Yes, No, Undefined

Have you tried:

combobox.data.parse(JSON.stringify(your_array));

This works for me …

I guess I said wrong :slight_smile:
I want to see “Yes, No, Undefined” in the Status column instead of 1, 2, 3

https://snippet.dhtmlx.com/27kpxfim

Something like this?

https://snippet.dhtmlx.com/y68gctek

Thanks. It’s better. But value is not displayed after editing

image

When your database value is different from your ‘display’ value, I believe all you need to do is set the value of the input to the value of the select, in a select.onchange event handler so it will retain your ‘number’ but show the ‘text.’.

Hope this helps …

Or this???

https://snippet.dhtmlx.com/hi7lrsfj

It is so difficult :slight_smile:
Solution must be easy. It’s a often situation for database tables

Currently, there is no native solution for the options labels in the ComboBox editor in the dhx.Grid, but we’re planning to extend that functionality in the 7.2 update.

1 Like