How make a select box in datatable?

I want to make a select box in datatable.
All I can think of is this way : Code Snippet
Is there a more efficient way?
This is difficult to managing options.
Help me if you know how!

Good day @chaeney ,

You may add various kinds of editors in your table’s columns.
Here you can find more information about it and examples. Editors “select”, “combo”, “richselect” or “miltiselect” can be especially helpful in your case.
Here you can also read more about defining options in these components .

I really appreciate it. Thanks @MariyaDemy
But I want it to be always selectable. at the page is loaded.
I want to use editor:“select”,
I want to maintain the drop-down appearance before and after the change, like the selection of general HTML.
Is it possible? thanks

@chaeney ,

Perhaps, this topics could be helpful: Datatable - Inline select editor ,
Visible selector button in datatable .

In fact, editor: “select” is a regular HTML-select that is rendered in a table cell every time the edit operation (for example, after click) is initialized so if nothing from above will not be suitable, it could be better to use your initial variant.

It helped me a lot. Thank you. I will try harder to make perfect what I want. Have a good day, @MariyaDemy