Datatable new row custom id

Right now datatable generates random id whenever i create a new row.
Is it possible to generate new id according to the last loaded data?

For example, i open the datatable there i have my json data loaded and the last id is 14 . So when i will add a new row the next id will be 15.

Or maybe there are documentation regarding this matter.
Thank you for your time.

There’s no built-in auto increment possibility within the library.

As a simplified solution, you can use .getLastId() method for getting the id of the last row, but since it depends on current order it will fail on sorting.

So, you have to iterate through all the rows to find the biggest value. You can use Datastore .each method for these needs: http://webix.com/snippet/bceacb06

Thank you !

Rather than this, you can even use:
var recIdsArray = datatable.data.order;
var lastRec = Math.max(…recIdsArray);

This should give you the lastRec id. Looping thru all the recs just to find the max value takes lot of time and makes it tedious if you have a million of records in store.