or
// use this to handle auto-increment for new rowsvar current = -1;function onChange(e) { if (e.action == "add") { var item = e.items[0]; item.ID = current; current -= 1; }}// ID = -1var item = dataSource.get(ID);// UID = undefined because the UID was generated thinking it was an ID of 0, not -1var uid = item.uid;