Thanks, cyee. I'm using the SQLlite proxy by Shepsii, which requires an id named 'id'. I'm a bit further along now, actually. Initially, I had the following code to copy the downloaded data to the local store:

where 'answersonline' refers to the store containing the the downloaded data and 'answers' refers to the offline store using the SQLlite proxy. I found that my app would apparently continue before the sync was complete, with the result that it would try to display a user answer which was not actually in the store. I discovered that inserting "console.log('answer copied')" would apparently ensure that all answers were in the offline store (presumably by slowing things down). I asked in the forum if anybody knew how to detect when the sync was complete and Mitch kindly supplied an answer, which, unfortunately, was sheer gobbledegook to me. However, I took him to be saying that I should call the sync after each record was added:

Whilst that did have the effect of ensuring that all the answers were in the table before moving on, it had the unfortunate side effect of creating multiple duplicates. I've now reverted to moving the sync outside the loop and find I now have just one of each record. (Curiously, if I downloaded 12 records, I got 12 copies of the first, 11 of the second, 10 of the third etc.) Anyway it's a relief that I now have no duplicates, BUT I still don't know how to detect when they have all been safely copied and synced to the offline store. The only relevant event I can see in the docs is beforeSync, which is the opposite of what I need. If anybody does know of an appropriate event to trap, please let me know - I'm afraid I struggle with the documentation.

There are two parts to this post - the first is what this chain was previously about, the second regarding what munder asked above.
--- 1---
I tried many things on this, and what worked for me was to only sync the stores on window unload. I added the following in Main.launch:

Code:

window.onbeforeunload = this.handleWindowBeforeUnload;

and for the unload,

Code:

Ext.getStore("LocalNotificationStore").sync();

Currently my solution is not duplicating any entries as it seemed that the duplication only came when saving the records. And only saving it once seems to work around that. It could well be that there are other fixes in the many that I tried that linger on in my project and they are contributing, but this was the last piece that i added which stopped the problem.

--- 2 ---
I recommend looping through all the records and adding them to your store, and then calling sync(). As mentioned above, each modification of a local storage record seems to cause duplication. Cannot say precisely why your approach is duping, but there it is. So your original code was better (for performance reasons as well), but what you may need to do is declare the record "dirty" for the sync to properly save it.

Thank you for you suggestion, alile. I'm afraid calling setDirty() has made no difference. It seems that sync() is not instantaneous, with the result that when the app progresses after supposedly filling the db table, the data aren't all there yet, so it coughs and splutters and falls over. I must say using (attempting to use) Sencha is a humbling experience. I've rarely felt quite so thick since being introduced to quantum mechanics in school and reading the docs is like an exercise in biblical exegesis. I recently produced in WinJS a version of the app I'm now trying to create in Sencha. A walk in the park in comparison. Good luck.

Thanks, Chrisman. I had in fact discovered that approach since posting my comment, but I'm grateful to you for suggesting a solution.
As it happens, I may well be dumping the WebSQL approach anyway, as it's been deprecated. Trouble is I don't know what to use instead, given that Apple are in no hurry to implement IndexedDB and previously adopted an alarmingly high handed approach to local storage. In my WinJS app, I simply downloaded the SQL result from the web service and stored it in a bunch of JSON files in the user's "roaming" storage area, but I don't quite get how I might do something similar with Sencha Touch.
Actually, I might even not use ST, since, by the time I had finished following all the advice on how to optimize my app, there wan't much of the ST magic left, and it still wasn't brilliantly responsive. I'm currently investigating Intel's XDK and waiting for the release of famo.us.