-
30 Jan 2012 9:20 AM #31
Thanks!
Thanks!
Hey once again.
You're absolutely right this helps me very much for now. I almost did the same like the one you mentioned. But I should have looked at he query. Of course you must define this on the last property else it will not work
Gretings Eryx
-
8 Feb 2012 1:03 PM #32
Hi tomalex,
thx for sharing this nice plugin. It was exactly what i was looking for.
I am stuck with a little problem here (just started whith sencha touch).
I have a json file containing data i want to import into my db when the app is started for the first time.
The json is an export from a database and looks similar to this structure:
I created the database and the table using your example (worked perfect).Code:{"21": { "firstname":"Alex", "lastname":"Testuser", "age":"43" }, "22": { "firstname":"Andy", "lastname":"Testuser2", "age":"23" }, <here come 200 more records> }
Do you have a little example or idea how i could "import" my json file?
Thx in advance.
Alex
-
2 Mar 2012 1:34 AM #33
If you gone through the Demo implementation, you will find Add functionality its like
create a record and then save it.
Based on your json data, you will have to iterate the json object and save record in the loop.
Code:[ { "21": { "firstname": "Alex", "lastname": "Testuser", "age": "43" }, "22": { "firstname": "Andy", "lastname": "Testuser2", "age": "23" } } ] Ext.iterate(a,function(key,obj){ var rec = Ext.ModelMgr.create(obj, 'ModelName').save(); });
-
7 Mar 2012 2:45 AM #34
Clarification
Clarification
Pardon my ignorance, but could you explain exactly what the SQLite Proxy can be used for? Could it be used for storing large media (i.e. pictures, Video) files in an SQLite database in the browser?
Thanks
-
9 Mar 2012 1:17 AM #35
Databaseversion
Databaseversion
Hi there it's me again

I'm struggeling a little bit with the changeversion of the database atm and I hope you may be able to help me.
My mainproblem is with this
I update my database with he method changeversion from 1.0 to 2.0, altering a table and all that goes well. My problem now is I don't now how to update the one in the code above. If I set it to 2.0 it will fail at first startup but works after a restart.PHP Code:/**
* @cfg {String} version
* database version. If different than current, use updatedb event to update database
*/
dbVersion: '1.0',
If I let it on 1.0 it will never work. Could you explain what you mean with updatedb event or how I could update the version in SqliteConnection.js.
Thanks for your time and have a nice day
Greetings Eryx
-
16 Mar 2012 6:37 AM #36
Hi Tomalex,
First I want to thank you for this great proxy, I started using it in sencha 1.1 and keep using it with this new version.
I have a little problem when trying to update an object. Actually I get my object model from the store, modify it and finally save it but the proxy keep trying to make an insert instead of and update.
Here is some code :
And this is my modelCode:var store = Ext.getStore('NewsStore'); var newsRecord = store.getById(id); console.log(newsRecord, 'News'); //update model with news content newsRecord.set('read',true); newsRecord.set('content','my new content'); newsRecord.save();
Code:Ext.define('Kaveat.model.News', { extend: "Ext.data.Model", config: { fields: [ {name: 'newsId', type: 'int', fieldOption: 'PRIMARY KEY'}, {name: 'type', type: 'int'}, {name: 'title', type: 'string'}, {name: 'content', type: 'string'}, {name: 'date', type: 'string'}, {name: 'read', type: 'boolean'}, {name: 'dateModified',type: 'string'} ], proxy: { type: 'sqlitestorage', dbConfig: { tablename: 'news', dbConn: Ext.DbConnection }, } } });
Do you have any idea on this issue?
Again thank you for work and for your answer
Ben
-
22 Mar 2012 8:57 AM #37
Hi Tomalex, I insert data to sqlite db withou proxy, but only with api instruction, bu I don't understand why the when I do customeStore.load() the it's empty. E declared proxy in model . . . Thank you in advance!
-
23 Mar 2012 1:55 PM #38
Ben, while I'm using SqliteProxy 2 and Sencha Touch 2, the same problem exists there too. I was able to finally track down the reason after back stepping through the code. It appears the system thinks it is a phantom record and because of this, it calls the create method instead of the update method. Unfortunately the only way around it so far I've found is to manually set the phantom flag:
That seems to fix it, though it isn't a great thing to manually be setting that, but don't see any other way around it at this time.Code:newsRecord.phantom = false;
-
4 Apr 2012 6:12 AM #39
SqliteProxy not working with Phonegap
SqliteProxy not working with Phonegap
I have been trying to get sencha 2 and sqlite 2 to work in phonegap but cant seem to.
The problem, it seems that my dbConfig, which are the first few line in the app.js file, right above Ext.application
The DbConnection code gets executed before phonegap is ready. I have tried multiple solutions to no avail. Anyone ever had this problem?Code:Ext.ns('DbConnection'); var dbconnval = { dbName: "dbStorage", dbDescription: "local storage db" }; Ext.DbConnection = Ext.create('Ext.Sqlite.Connection',dbconnval); Ext.application( etc etc)
The error that I am getting is INVALID_STATE_ERR: DOM EXCEPTION 11: An attempt was made to use an object that is not, or is no longer usable.
Any help would be greatly appreciated.
-
5 Apr 2012 9:46 PM #40
Sqlite proxy
Sqlite proxy
Hello Team,
I am trying to use the Sqllite proxy for Sencha Touch. I got the latest code from the github.
Not knowing what exactly has to be done with it, cause am very new to Sencha touch and sqlllite,
I put the "sqlite.js in store", "override.js in model" and "sqliteproxy.js and sqlliteconnection.js in views".
I get an error that says sqlite.js not found. Any idea what am i missing in this.
Thanks in advance.
Khushbu


Reply With Quote