1. #191
    Sencha User
    Join Date
    Jan 2012
    Location
    London, UK
    Posts
    498
    Vote Rating
    51
    shepsii has a spectacular aura about shepsii has a spectacular aura about shepsii has a spectacular aura about

      0  

    Default


    You should be using the sencha touch 2.2 proxy if you're on 2.2 now as that works fine for me. It filters using queries on the database with the filters param rather than remoteFilters but this works just fine.

    I would recommend people switch over.

    As for persistancy, please be aware that sqlite and websql are different things. They happen to share, for the most part, their query language, but here is the main difference:
    - websql is a browser based database implementation. Sometimes it works on a sqlite backend. The W3C have abandoned the specification for this since 2010, but it remains implemented in nearly all modern browsers. IT IS NOT TRULY PERSISTENT! Any user can delete the data from the browser at any time they wish.
    - sqlite is a type of database that can be accessed on most platforms, and relevantly here iOS and Android. It is NOT websql, although websql may be working with a sqlite implementation. Sqlite itself is therefore only available through natively packaged apps, and you'll need something other than HTML and Javascript to implement it. I believe Sencha has implemented such a feature in 2.2 and there are cordova plugins available. If you use these, then the application that has control of the database is your app - not the browser. You can control where the sqlite file goes, therefore controlling its persistency (make sure you put it in the relevant place on iOS - this is determined by whether the data is user generated (needs to go in icloud folder) or data that could be redownloaded again from your servers).
    I blog about Sencha Touch at www.senchatouchdev.com

  2. #192
    Sencha User
    Join Date
    Nov 2012
    Posts
    23
    Vote Rating
    1
    Manoj Solanki is on a distinguished road

      0  

    Default Problem with store count.

    Problem with store count.


    Hello friends,

    I have a table which having some records(Users). But I can not get store count in app.js launch function.

    console.log(Ext.getStore('User_S').getCount());
    console.log(Ext.getStore('User_S').getAllCount());

    Store:
    Ext.define('ListDemo.store.User_S',
    extend: 'Ext.data.Store',
    requires: ['ListDemo.model.User_M'],
    config: {
    model:'ListDemo.model.User_M',
    autoLoad: true,
    autoSync :true
    }
    });

    Model:


    Ext.define('ListDemo.model.User_M', {
    extend: 'Ext.data.Model',
    config: {
    fields:[{name:'id',type:'int'},
    {name:'name',type:'string'},
    {name:'password',type:'string'},
    {name:'email',type:'string'},
    {name:'phone',type:'string'}],
    proxy:{
    type: 'sqlitestorage',
    dbConfig: {
    tablename: 'tblUser',
    dbConn: ListDemo.util.InitSQLite.getConnection()
    }
    },
    validations: [
    {type: 'presence', field: 'password',message:'Password can not be blank'},
    {type: 'length', field: 'name', min: 4, message:'Name must be greater than 4 character'},
    ]
    }
    });

    Please help.

    Thanks

  3. #193
    Sencha User
    Join Date
    Jan 2012
    Posts
    21
    Vote Rating
    0
    jastako is on a distinguished road

      0  

    Default


    Hi @Manoy Solanki,

    First of all, what are the logs?

    If you are deploying your app on device and testing it against its native SQLite DB, which is stored in FS, rather than HTML5 WebSQL, you have to wait with populating store with data until DB is accessible. That is (in PhoneGap world) you would wait for "deviceready" signal and then query handle to DB (which API is compatible with HTML5 WebSQL). In your approach you make attempt to access DB on app launch, by specifying model's proxy. Wait with this, until "deviceready" is emitted and then assign such proxy to your S-T-O-R-E .

    However, if submitted snippet doesn't work on your local machine in the web browser with WebSQL DB support I would recommend you to assign this proxy to store rather than model. At least I tend to do so, such a way and it works all the time.

    Hope it helps.

    Cheers,
    Kuba

  4. #194
    Sencha User
    Join Date
    Nov 2012
    Posts
    23
    Vote Rating
    1
    Manoj Solanki is on a distinguished road

      0  

    Default DB linking at the time of LAUNCH fucntion.

    DB linking at the time of LAUNCH fucntion.


    Thanks Kuba,

    You are correct at the time of launch function the connection with DB table is not established.

    Thanks again.


    Quote Originally Posted by jastako View Post
    Hi @Manoy Solanki,

    First of all, what are the logs?

    If you are deploying your app on device and testing it against its native SQLite DB, which is stored in FS, rather than HTML5 WebSQL, you have to wait with populating store with data until DB is accessible. That is (in PhoneGap world) you would wait for "deviceready" signal and then query handle to DB (which API is compatible with HTML5 WebSQL). In your approach you make attempt to access DB on app launch, by specifying model's proxy. Wait with this, until "deviceready" is emitted and then assign such proxy to your S-T-O-R-E .

    However, if submitted snippet doesn't work on your local machine in the web browser with WebSQL DB support I would recommend you to assign this proxy to store rather than model. At least I tend to do so, such a way and it works all the time.

    Hope it helps.

    Cheers,
    Kuba

  5. #195
    Sencha User
    Join Date
    Aug 2014
    Posts
    3
    Vote Rating
    0
    juanlubarreda is on a distinguished road

      0  

    Default How to configure this override?

    How to configure this override?


    Quote Originally Posted by vadimv View Post
    My tests just showed that the best solution for SQLite within ST2.1 & Phonegap 2.2.0 is to use Phonegap plugin from https://github.com/brodyspark/PhoneGap-sqlitePlugin-iOS and default ST SQL proxy: Ext.data.proxy.SQL with the override:
    Code:
    Ext.define('Ext.data.proxy.SQLOverride', {
        override: 'Ext.data.proxy.SQL',
       
        getDatabaseObject: function() {
            if(Ext.os.is.Android){
                //TODO: add android part
            }
            else 
            if (Ext.os.is.iOS && !navigator.platform.toLowerCase().match(/simulator/)) {
                return sqlitePlugin.openDatabase("data.sqlite");
            }
           return this.callParent();
        }
     });
    What doi have to do to use this override?

    In App.js add a require?
    Where should be located the file with the code you specified?

    I'm a little lost on overrides,

    Thank you!

Turkiyenin en sevilen filmlerinin yer aldigi xnxx internet sitemiz olan ve porn sex tarzi bir site olan mobil porno izle sitemiz gercekten dillere destan bir durumda herkesin sevdigi bir site olarak tarihe gececege benziyor. Sitenin en belirgin ozelliklerinden birisi de Turkiyede gercekten kaliteli ve muntazam, duzenli porno izle siteleri olmamasidir. Bu yuzden iste. Ayrica en net goruntu kalitesine sahip adresinde yayinlanmaktadir. Mesela diğer sitelerimizden bahsedecek olursak, en iyi hd porno video arşivine sahip bir siteyiz. "The Best anal porn videos and slut anus, big asses movies set..." hd porno faketaxi