combo/select with options item id=0 get wrong form value

I use combo in the form with options item id=0

options = [
{id: 0, value: “Empty”},
{id: 1, value: “One”},
]
{ view: “combo”, option: options, name: “ItemType” }

when I select 1st “Empty” item with id=0, form.getValues() returns strange value:
{ ItemType:12345678912334, … }
but must
{ ItemType: 0 }

That is a limitation for all Webix Data components, they will not work with such ids as 0, false, null.

Hmmm… Very strong limitation, in my opinion, because ‘options’ is a key-value map for any data, for example:

false,null,true (for three-state values)
0,1,2 (enumerator)
0,1,2,3,4,5 (range value)
-1,0,1 (fuzzy logic value)

Have you any ideas to avoid such conflict?
What about using ‘key-value’ instead of ‘id-value’?
Sample:
options: [ {key: 0, value: “Zero”}, …]

More than, usually use KeyMember, ValueMember to calculate required data members, because server can return any data, not only in ‘id-value’ format. It’s a good standard practice

While it may sound as a serious limitation, it is really not so critical. Each data item in can have any number of extra properties, so you already can have

{ key:1, value:"Empty" } 

getSelected API will not return the key value, but the next construct will return the necessary data

var key = list.getItem( list.getSelectedId() ).key;

Ok, it’s a good solution, thank you, Maksim!

May I ignore id in data?

Yep, if id is not provided it will be auto-generated.

Unfortunately, the top problem remains

form.getValues() gets id from combo options, not the key.
I suspect this is right for gridtable columns, when I use combo/select editor

It can be solved by redefining getValue method, but code becomes more and more complicated.

Maybe it will be more simple to add a code that will change 0 id to some othe value ( -1 for example ) during data loading, and restore it back before data saving.

Oh… It’s possible, but make code non-obvious and complex ((

May be add config.keyName supporting to calculate GetValue() with default string ‘id’?
i.e. only change in the GetValue() method:
… return row.id
to the next code:
… return row[config.keyName] ?