There's setItemData() for exactly this purpose. You can associate any kind of data with the items and then add/reorder/delete them and the data stays and can be queried with itemData() or currentData()
For example: