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

      0  

    Default Unanswered: Question about app startup order: developement and package/tesing build.

    Unanswered: Question about app startup order: developement and package/tesing build.


    Question about app startup order: developement and package/tesing build.


    I am implementing custom sqlite proxy and define in Model definition. I also add code at app onReady to init stuff.
    In developement enviroment, the startup order is: app's onReady -> models 's proxy init, which is OK
    But when i build testing/package using sencha command (Sencha 2.1 beta and Sencha CMD v190): models 's proxy init - > app's onReady , which is NG for my case.


    How can i work around it.


    Thank you and best regards.


    My code


    The model:
    Code:
    Ext.define('XXX', {
                extend : 'Ext.data.Model',
                requires : ['XXX.util.InitSQLite'],
                config : {
                    fields : [{
                                name : 'id',
                                type : 'int'
                            }, {
                                name : 'body',
                                type : 'auto'
                            }, {
                                name : 'story_id',
                                type : 'string'
                            }],
                    proxy : {
                        type : 'sqlitestorage',
                        dbConfig : {
                            tablename : 'xxx',
                            dbConn : XXX.util.InitSQLite.getConnection()
                        }
                    }
                }
            });
    and on application i add code in onReady
    Ext.application({
    ....
    Code:
    Ext.application({
        ....
        onReady : function() {
            DftStory.util.InitSQLite.initDb();
        },

  2. #2
    Sencha User
    Join Date
    Apr 2010
    Location
    China
    Posts
    227
    Answers
    64
    Vote Rating
    20
    haduki will become famous soon enough haduki will become famous soon enough

      0  

    Default


    onReady?why not launch?
    I write English by translator.

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

      0  

    Default


    app's onReady is lauched but the execution order is diffirent between development and build enviroment.

    In development enviroment, execution order
    which is OK
    1.
    app's onReady
    2. model's proxy initialization

    In package/testing build,
    execution order is reversed which is NG
    1. model's proxy initialization
    2. app's onReady

    Thank for your reply.

  4. #4
    Sencha User
    Join Date
    Apr 2010
    Location
    China
    Posts
    227
    Answers
    64
    Vote Rating
    20
    haduki will become famous soon enough haduki will become famous soon enough

      0  

    Default


    Code:
    Ext.define('XXX', {
                extend : 'Ext.data.Model',
                requires : ['XXX.util.InitSQLite'],
                config : {
                    fields : [{
                                name : 'id',
                                type : 'int'
                            }, {
                                name : 'body',
                                type : 'auto'
                            }, {
                                name : 'story_id',
                                type : 'string'
                            }],
                    proxy : {
                        type : 'sqlitestorage',
                        dbConfig : {
                            tablename : 'xxx',
                            dbConn : (function(){
    DftStory.util.InitSQLite.initDb();
    return XXX.util.InitSQLite.getConnection()
    })()
                        }
                    }
                }
            });
    I write English by translator.

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

      0  

    Default


    Thank you haduki.

    I tried but the models' proxy init process is still run before the app onready event which should be run first as usual in development enviroment.

    I also tried to modify the order off class definition in app.js which is generated by testing/package build but still no luck.

Thread Participants: 1

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