Unable to add records in datatable with ID = 0

Hello!

Looks like it’s not possible to add record into empty datatable with numeric id equal to 0 (zero). Zero string can be added and accessed through 0 though.
Please see this snippet:
http://webix.com/snippet/bdf850a5

Cheers!

It’s a necessary limitation for all Webix Data components. Please avoid such IDs asnull, false, 0.

Are you really storing record with “0” as id in the database, or you need such kind of record for some specific scenario ?

Hello,

I have the requirement to store records with “0” as id in a database. Is there a any way to have 0 as id in a component?

Thanks, peter

Hello @peterlechner,

I’m afraid not. At least you can try to use string “0”, but there’s no other way to avoid this limitation.