Coder Social home page Coder Social logo

senchatouch-v2-sqliteproxy's Introduction

Sqlite proxy to handle Db operations. This meant to work with Sencha Touch v2


Changes
fixed issue in safari 5 and ios 5.
fixed , issue with searching based on query.
dbConn: Ext.DbConnection.dbConn  should be changed to
dbConn: Ext.DbConnection


Issue

mapping property is not working with fields

senchatouch-v2-sqliteproxy's People

Contributors

tomalex0 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

senchatouch-v2-sqliteproxy's Issues

Mapping not working with Model

Some how mapping property in Model is not working as it should .

{
name : 'modifyDateParsed',
type : 'string',
mapping : 'modifyDate', // not working
isTableField : false, //newly implemented to distinguish field
convert : function(value,rec){
var dt = Date.parseDate(rec.get('modifyDate'), "Y-m-d H:i:s")
newval = dt.format('M j, Y, g:i a');
return newval;
}
}

Copyright holder and license

Thanks for sharing this code. Could you please clarify who the copyright holder is and what license it is being released under, thanks.

5mb data limit?

This implementation have a 5mb data limit, like a WebSQL?

Limitation of using id as idProperty and fieldname

If we have table field name as "id" which is a primary key, we will have to mention a dummy name(not a field in table) as idProperty of model and clientIdProperty as "id". The issue is that default idProperty of model is "id" which will always have value like this "ext-record-x". If mentioned config options are not specified in model, id value in table will be like ext-record-1,2,3. But we expect it as integer.

Example

Ext.define("Contacts", {
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: 'firstName',
                type: 'string'
            }, {
                name: 'lastName',
                type: 'string'
            },{
                name: 'id',
                type: 'int',
                fieldOption: 'PRIMARY KEY'
            }, {
                name: 'modifyDate',
                type: 'string'

            }, {
                name: 'modifyDateParsed',
                type: 'string',
                mapping: 'modifyDate', // not working
                isTableField: false,//newly implemented to distinguish field
                convert: function(value, rec) {

                    var dt  =  Ext.Date.parseDate(rec.get('modifyDate'), "Y-m-d H:i:s")
                    newval  =  Ext.Date.format(dt,'M j, Y, g:i a')
                    return newval;
                }
            }],
            proxy: {
            type: 'sqlitestorage',
            dbConfig: {
                tablename: 'contacts_tables',
                dbConn: Ext.DbConnection.dbConn
            },
            reader: {
                type: 'array'
            }
        }   
        },
        writer: {
            type: 'array'
        }
    });

proxy error with ST 2 RC

sencha touch 2 RC
Chrome : ok
Android : ok
Safari (desktop and mobile) :
TypeError: Type error SqliteProxy.js:137

Undefined is not a object

Hi All,

I am using these SqliteStorage Js file and I am hitting an issue when I run it on my safari browser.
I get 'Type issue : undefined is not a object' while evaluating this.config.dbConfig.dbConn.dbConn.

But I put in breakpoints at the getDb function in the js file and found that the dbConn is defined but i am not able to get over this issue. Any pointers could be great.

getDb: function () {
return this.config.dbConfig.dbConn.dbConn

Thank you,
Divya.

Can't save number "0"

Every time i tried to save some field whit the value "0" that value gets set to "NULL".

discountCode N
rate 0
["discountCode"] "fields"
["N"] "values"

The only way i can workaround this is using type string.

discountCode N
rate 0
["discountCode", "rate"] "fields"
["N", "0"] "values"

Excess fields in db

In the method constructFields you fetch the fields from the model. But not only my model fields got added but these extra fields too:

    parentId TEXT,
    index INTEGER,
    depth INTEGER,
    expanded bool,
    expandable bool,
    checked auto,
    leaf bool,
    cls TEXT,
    iconCls TEXT,
    root boolean,
    isLast boolean,
    isFirst boolean,
    allowDrop boolean,
    allowDrag boolean,
    loaded boolean,
    loading boolean,
    href TEXT,
    hrefTarget TEXT,
    qtip TEXT,
    qtitle TEXT

This resulted in an error when trying to add a column called index...

I temporary solved this by explicitly setting the 'isTableField: true' parameter and removing the part where it could be undefined.

Line 158:

    if(f.config.isTableField || !Ext.isDefined(f.config.isTableField)){
        /* ... */
    }

I'm not 100% shure but this proxy doesn't support treedata (yet), am I right? I would like to add that support.

You have any idea how to get the hasMany or hasOne properties out?

I got an Event model the event model hasMany 'cost' and hasMany 'participant'

me.getModel().prototype returns the the model and I see cost and costStore, participant and participantStore but can't find an array containing the child objects (ex: ['cost', 'participant'] ).

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.