-
3 Oct 2012 5:05 AM #141
Hi Qumhieh,
The Proxy works like a webproxy, so if you use a filter to retrieve your 1 record you will only have the one record in memory. That's the way we use the DB. We filter to the records we need and don't rely on the findxxx functions for the major lookups.
Just remember that you will need to do some finagling on the filters to clear them out since they stack on top of each other. So if you do a filterAnd then try to do another filterCode:store.filter('eyeColor', 'Brown')
You will have no records left since you are saying filter where eyeColor is both Blue and Brown. You have to clear the filters and reapply them.Code:store.filter('eyeColor', 'Blue')
Bob
-
3 Oct 2012 6:37 AM #142
Thanks for the reply shepsii.
Which version of PhoneGap and SqLite do you have. Is it the latest one?
I tired the example and having the same issue with ridan with PhoneGap 2.1.0 and this latest SQLite Plugin https://github.com/chbrody/Cordova-SQLitePlugin.
-
3 Oct 2012 6:50 AM #143
It was 1.x phonegap not 2.x... wish I could be more specific but don't have the time to dig up the files right now, sorry!
-
8 Oct 2012 8:40 AM #144
Thank shepsii for you work.
I am building Phonegap2.1 + lastest Sqlite Proxy + lastest Sqlite Plugin for Android with Sencha 2.1 Beta 3 (RC1 now) and Sencha CMD 3 v190. However the models still be initiated and their proxies created BEFORE the onReady method of the Ext.Application call is executed when i build package/tesing -> it is still OK in development enviroment.
I have double checked and applied your lasted fix related to the issue, but it seem not OK on Sencha 2 Beta 3.
Can you please help us work around.
-
9 Oct 2012 6:40 AM #145
Thanks for reply shepsii and badgerb1
i have another question, on the application launch event i need to check data from database before any view
created, so what im trying to do is get the store and find the record im looking for (Ext.getStore('store').findRecord()), but its seems during launch event all stores still empty and they get data after launch event done. (i add 'autoload : true' to store but still not works)
so how i can get the data before any view created?
-
10 Oct 2012 5:00 PM #146
I have asked sencha team in here : http://www.sencha.com/forum/showthread.php?245491-Sencha-2RC1-Sencha-CMD-v.190-App-onready-event-order-is-incorrect-in-package-build&p=898047#post898047
Hopefully, we can continue to use sqlite plugin in next sencha release.
Note: i also adapted sqlitestorage of shepsii with sqlite plugin for Android on Phonegap 2.1.
-
11 Oct 2012 2:03 AM #147
You need to realise that loading from a database is not an instant event - it takes time.
So if you just call store.load() or set autoLoad to true, you can't assume data will be there instantly.
If you want to be able to make that assumption, listen to the load event on the store, and when this event fires, then instantiate your UI.
anhnt3 - could you share your adapted file - perhaps by branching on github? I wish I could spend the time tracking this down myself, personally I used Sencha Touch 2.1 and thought it was still a complete mess and nowhere near production ready. Promising, but when the general release happens, which in my experience with Sencha will be equivalent quality to a release candidate, I'll treat that as a RC and go through it filing all the bugs I can find... excuse my cynicism that there will still be loads!
-
11 Oct 2012 2:13 AM #148
There is no tx.executeSql interface in Sqlite Phonegap Plugin, it only support transactionDB API.
So in your setTable function, esspecially createTable, checkDataExists and checkExistingSchema, I must modify to use transactionDB.
Since then when application startup in native Android, DB and table is created succesfully.
Other operation like read,create... I am trying but currently I cannot work around [model 's proxy init before app' onready] problem in package build
(Sencha 2.1 and Sencha CMD 3 v/190)
-
11 Oct 2012 4:51 AM #149
-
24 Oct 2012 2:07 PM #150
I'm interedted in your sqlite proxy, but I have a few questions :
How to make the demo work ?
We have to test it with phonegap/cordova ?
Do you have a tutorial to do an application with the proxy ?


Reply With Quote
