1. #41
    Sencha User
    Join Date
    Mar 2012
    Posts
    28
    Vote Rating
    0
    gcw07 is on a distinguished road

      0  

    Default


    I'm trying to set this up using the newer Ext.application method of creating the app instead of the onReady way you have in the demo. I'm able to get it partly working, but I can't figure out how to get rid of a warning. At first I tried having everything within the Ext.application, but that caused errors with the stores because it was loading them up before the database was initiated. So I moved the database connection outside of the Ext.application.

    Code:
    //<debug>
    Ext.Loader.setPath({
        'Ext': 'sdk/src',
        'Ext.Sqlite.Connection': 'lib/SqliteConnection.js',
        'Ext.data.proxy.SqliteStorage': 'lib/SqliteProxy.js'
    });
    //</debug>
    
    Ext.ClassManager.setAlias('Ext.data.proxy.SqliteStorage', 'proxy.sqlitestorage');
    Ext.namespace('DbConnection');
    
    // Setup the database
    var dbconnval = {
        dbName: 'testapp',
        dbDescription: 'Test App Database',
        dbVersion: '1.00',
    };
    
    // Has no effect on the warning
    //Ext.require(['Ext.Sqlite.Connection','Ext.data.proxy.SqliteStorage']);
    
    // Create database connection
    Ext.DbConnection = Ext.create('Ext.Sqlite.Connection', dbconnval); // line that is causing the warning
    
    Ext.application({
    ....
    and the warning I keep getting:
    Code:
    [WARN] [Ext.Loader] Synchronously loading 'Ext.Sqlite.Connection'; consider adding 'Ext.Sqlite.Connection' explicitly as a require of the corresponding class
    Any help in figuring this out or even narrowing it down with be greatly appreciated. Thanks.

  2. #42
    Sencha User
    Join Date
    Mar 2012
    Posts
    5
    Vote Rating
    0
    daveik is on a distinguished road

      0  

    Default


    I was trying to get it running with the ST native wrapper. Unfortunately, without any success. It works fine with phonegap, though.

  3. #43
    Sencha User
    Join Date
    Mar 2012
    Posts
    8
    Vote Rating
    0
    eeldwin is on a distinguished road

      0  

    Default


    I used sencha 2.0 (commercial release) and phonegap 1.4.1 to run the demo for SQLiteProxy. The interface is appeared fine on the emulator, but it can't add new user and list the existing user.

    Tried to debug add user functionality, just found out that the form, validation, and data input were fine, until it reach setRecord function

    console.log(record.getData().id,"recprd2");

    The record.getData().id will return null value.

    Anyone experienced this problem?

  4. #44
    Sencha User
    Join Date
    Aug 2011
    Posts
    18
    Vote Rating
    0
    Whitejoker is on a distinguished road

      0  

    Default


    Is it possible to use associations with this proxy? If so do you have an example on how to use these?

  5. #45
    Sencha User
    Join Date
    Feb 2012
    Location
    New York, NY
    Posts
    52
    Vote Rating
    3
    roycyang is on a distinguished road

      0  

    Default Websql or SQLite?

    Websql or SQLite?


    I read though this and saw that this question wasn't fully answered (I think).

    Is this websql or SQLite? The reason I'm asking is because I've been hearing that iOS 5.1 can randomly delete our local storage and websql data. I'm now looking for SQLite only solutions that won't be deleted.

    I'm planning on running iOS 5.1 with phonegap 1.5 (why oh why did they rename it Cordova? (stupid adobe) and I think the current phonegap SQLite plugin is only available for PG1.3 and I'm looking for a sencha solution for the sake of my sanity while I develop and error test.

  6. #46
    Sencha User
    Join Date
    Mar 2012
    Posts
    8
    Vote Rating
    0
    eeldwin is on a distinguished road

      0  

    Default


    Quote Originally Posted by roycyang View Post
    I read though this and saw that this question wasn't fully answered (I think).

    Is this websql or SQLite? The reason I'm asking is because I've been hearing that iOS 5.1 can randomly delete our local storage and websql data. I'm now looking for SQLite only solutions that won't be deleted.

    I'm planning on running iOS 5.1 with phonegap 1.5 (why oh why did they rename it Cordova? (stupid adobe) and I think the current phonegap SQLite plugin is only available for PG1.3 and I'm looking for a sencha solution for the sake of my sanity while I develop and error test.
    just found out that this proxy doesn't work for ios 5.1, but work perfectly for 5.0

  7. #47
    Sencha User
    Join Date
    Feb 2012
    Posts
    86
    Vote Rating
    0
    alohainc is on a distinguished road

      0  

    Default bind store in controller

    bind store in controller


    Hi following is my code,

    Code:
    var sampleStore = Ext.data.StoreManager.get('sampleStore');
            sampleStore.load({ params: { }, query: 'SELECT Name, Desc  FROM SampleTable WHERE ID = (SELECT MAX(ID) FROM SampleTable' });
    here simply I am trying to get the last row of data in store in controller file, but it is giving all the rows. Please help.

  8. #48
    Sencha User
    Join Date
    Nov 2011
    Posts
    6
    Vote Rating
    0
    MauiRa is on a distinguished road

      0  

    Default Native SQLite3 in IOS with phonegap plugin *.m, *.h, *.js

    Native SQLite3 in IOS with phonegap plugin *.m, *.h, *.js


    This is the source for a native SQLite plugin within IOS and a .js file for that plugin.

    Herein also lies a SQLiteConnection.js file that open a native connection for either Android or IOS while opening a webdata connection for pure web browsers.

    There are many examples in previous posts on loading the js files.

    Make sure the phonegap1.4.1.js file is first loaded, then the pgsqlite_plugin.js for IOS and the SQLiteConnection.js after the two.

    Android already has a native sqlite 3 implementation with storage and the SQLiteConnection.js makes use of the DroidDB_openDatabase function to the native code.

    Under <key>Plugins</key> in the PhoneGap.plist, add this key value pair:

    <key>PGSQLitePlugin</key>
    <string>PGSQLitePlugin</string>
    Attached Files

  9. #49
    Sencha User
    Join Date
    Oct 2011
    Posts
    6
    Vote Rating
    0
    rojalin@ceptes.com is on a distinguished road

      0  

    Default How to insert multiple records to the table

    How to insert multiple records to the table


    Hi,
    Can somebody please help me to get the solution
    Is there any way to save multiple records at a time to a sqlite table .
    I am trying in the following way..

    The model structure is like
    Code:
    Ext.define("WorkOrder", {
                extend: "Ext.data.Model",
                
                config : {
                    idProperty : 'uniqueid', // if we have field with name as id, conflicts happens with default idProperty(id) which always have value as ext-record-x
                    clientIdProperty : 'Id',
                    fields: [{
                        name: 'Id',
                        type: 'string',
                        fieldOption: 'PRIMARY KEY'
                    }, {
                        name: 'Name',
                        type: 'string'
                    },{
                        name: 'CreatedDate',
                        type: 'string'
                        
                    }],
                    proxy: {
                    type: 'sqlitestorage',
                    dbConfig: {
                        tablename: 'WorkOrder',
                        dbConn: Ext.DbConnection
                        },
                    reader: {
                        type: 'array'
                    }
                }    
                },
                writer: {
                    type: 'array'
                }
            });

    I want read the data from json file put all the data to the table(WorkOrder).
    The .json file
    Code:
    {
    
    
    "records":[
    {
    "attributes":{
    "type":"Account",
    "url":"/services/data/v22.0/sobjects/Account/0019000000556qrAAA"
    },
    "Id":"0019000000556qrAAA",
    "Name":"Sameer Roy1",
    "CreatedDate":"2011-03-22T04:56:15.000+0000"
    },
    {
    "attributes":{
    "type":"Account",
    "url":"/services/data/v22.0/sobjects/Account/0019000000A9xaBAAR"
    },
    "Id":"0019000000A9xaBAAR",
    "Name":"MR.Jone",
    "CreatedDate":"2012-03-07T06:32:56.000+0000"
    },
    {
    "attributes":{
    "type":"Account",
    "url":"/services/data/v22.0/sobjects/Account/00190000006JHSJAA4"
    },
    "Id":"00190000006JHSJAA4",
    "Name":"GenePoint",
    "CreatedDate":"2011-03-03T12:57:09.000+0000"
    }
    ]
    }

    This is way i have tried to insert into table,

    Code:
      var recordArray = [];
                    for( i in records )  { //records are the json result object
                    record = records[i] ;
                    var recordObj={  //Here tried to create a  object of key /value
                        Id:    record['Id'],
                        Name:record['Name'],
                        CreatedDate:record['CreatedDate']
                     }
                    recordArray.push(recordObj);
                    }
                    console.log('recordArray[0]##################################'+recordArray);
                    var rec = Ext.create('WorkOrder', recordArray).save();

    The following giving the result by inserting [object Object] to all columns.If am not using the recordArray instead inserting the recordObj,then its only inserting the last value of the json result.

    How I can insert all the values in json file to the table?????????
    Thanks in advance...

  10. #50
    Sencha User
    Join Date
    Jan 2012
    Location
    London, UK
    Posts
    482
    Vote Rating
    48
    shepsii has a spectacular aura about shepsii has a spectacular aura about shepsii has a spectacular aura about

      0  

    Default


    So I think your task would be easier with the more advanced proxy found here:
    http://www.sencha.com/forum/showthread.php?195991-SQLite-Proxy-for-ST2-(advanced)

    I
    t is more advanced, and therefore what you need to do is simpler.

    Notice you'll need to change the fields of your model a little, build it out from the example included.

    Regardless of which proxy you use, you want to do something like this:

    1. Load in data using a json proxied store
    2. Iterate through loaded data (after it has been loaded) and copy each record.
    3. Add copy of record to new store using a sqlite proxy
    4. Set these new copies to be a phantom (just record.phantom = true does the job)
    5. Sync the new store.

    The reason I suggest using the advanced proxy, is that it will group all the insert queries into one database transaction, which will be quicker, and the operation will only be marked as finished when the transaction has completed. This means that you can listen to the write event of the store, for instance, and act there knowing the data has been inserted.

    Your approach at the moment suffers because the fields on your model are more complicated than they need to be, and the way you're copying the records now means that if you change the fields, you have to go and change the copy record code too which isn't ideal.

    Also, I can't remember if the sqlite proxy of this thread is compatible with the date type, but the advanced proxy is, so if you used that you could change the createdDate field to have date type, which semantically would make much more sense.

film izle

hd film izle

film sitesi

takipci kazanma sitesi

takipci kazanma sitesi

güzel olan herşey

takipci alma sitesi

komik eğlenceli videolar