1. #141
    Sencha Premium Member
    Join Date
    Oct 2011
    Location
    Duluth, MN
    Posts
    126
    Vote Rating
    4
    badgerb1 is on a distinguished road

      0  

    Default


    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 filter
    Code:
     store.filter('eyeColor', 'Brown')
    And then try to do another filter
    Code:
    store.filter('eyeColor', 'Blue')
    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.

    Bob

  2. #142
    Sencha User
    Join Date
    Sep 2012
    Posts
    3
    Vote Rating
    0
    tling is on a distinguished road

      0  

    Default


    Quote Originally Posted by shepsii View Post
    For ridan's problem, I deployed with ST2 + Phonegap + SqLite Proxy and did not have any issues. Hopefully I have some time to look into this further for you guys, in the meantime I would say start with the example code, this definitely works, then adapt from there. When it doesn't work anymore, take a look at what you just changed...
    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. #143
    Sencha User
    Join Date
    Jan 2012
    Location
    London, UK
    Posts
    497
    Vote Rating
    51
    shepsii has a spectacular aura about shepsii has a spectacular aura about shepsii has a spectacular aura about

      0  

    Default


    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!

  4. #144
    Sencha User
    Join Date
    Feb 2012
    Posts
    19
    Vote Rating
    0
    anhnt3 is on a distinguished road

      0  

    Default


    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.

  5. #145
    Sencha User
    Join Date
    May 2012
    Posts
    6
    Vote Rating
    0
    Qumhieh is on a distinguished road

      0  

    Default


    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?

  6. #146
    Sencha User
    Join Date
    Feb 2012
    Posts
    19
    Vote Rating
    0
    anhnt3 is on a distinguished road

      0  

    Default


    Quote Originally Posted by anhnt3 View Post
    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.
    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.

  7. #147
    Sencha User
    Join Date
    Jan 2012
    Location
    London, UK
    Posts
    497
    Vote Rating
    51
    shepsii has a spectacular aura about shepsii has a spectacular aura about shepsii has a spectacular aura about

      0  

    Default


    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!

  8. #148
    Sencha User
    Join Date
    Feb 2012
    Posts
    19
    Vote Rating
    0
    anhnt3 is on a distinguished road

      0  

    Default


    Quote Originally Posted by shepsii View Post
    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!

    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)

  9. #149
    Sencha User
    Join Date
    May 2012
    Posts
    6
    Vote Rating
    0
    Qumhieh is on a distinguished road

      0  

    Default


    Quote Originally Posted by shepsii View Post
    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.
    thanks shepsii.....thats works !!!

  10. #150
    Sencha User
    Join Date
    Jun 2010
    Location
    France
    Posts
    44
    Vote Rating
    0
    ludm is on a distinguished road

      0  

    Default


    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 ?