Right now I have a problem with the way Sencha stores work. I have a model that I persist to a remote table. The table has an autoincrement id. When I create a new record and add it, Sencha creates it in the store and gives it a "ext-record-X" id. The autoincrement is handled in the server, that's not a problem, but should I update the id of the record in the store when the insert is successful ? If I don't, then how can I modify that record ? I don't know its id, and the server has no way to know that "ext-record-5" is actually the record with id = 45.
I'm not sure I'm being clear. My problem is that the remote database identifies records with different IDs than the Sencha stores, so it makes modifying and deleting records from the store difficult to sync with the database. If I update the id of the record after each successful insert it would solve the problem but it would still introduce two other problems :
1. The record would become dirty when it's not really dirty
2. There would be a time gap (when waiting for the server's response) where you can't update or delete the record even though it's there in the store.
Any suggestions ?