Results 1 to 2 of 2

Thread: offline design questions

  1. #1
    Sencha Premium Member
    Join Date
    Feb 2012
    Vote Rating

    Default offline design questions

    I am creating an app that will be native packaged as it requires to be run when out of phone coverage.I thought of caching and localstore but need to be told when going on/off line. I have got the sections where it goes to localstore if offline and synchs localstore if online. From the docs, you can add an onlinechange event:
           // scope: this,
            onlinechange: this.onlineChange
      onlineChange: function (online, type) {
            alert(online + type);
    but have been told that this will only work when native packaged as the event relies on the device.
    Also, if this event fires in the middle of doing dome other work (e.g. entering data or taking picture via app) will the other work freeze while the online function completes or is there a way to do the online updates in the background?
    So 3 questions:
    1. Do I have to package to get the event?
    2. Can I run the online function in the background?
    3. Is there a better way to do this.

  2. #2
    Sencha - Sr Software Engineer mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Gainesville, FL
    Vote Rating


    To get an event yes you need to be packaged but for offline you do not. You can check navigator.onLine to see if the device is online.
    Mitchell Simoens @LikelyMitch
    Sencha Inc, Senior Software Engineer
    Learn BBCode and use it!

    Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2

    Think my support is good? Get more personalized support via a support subscription.

    Need more help with your app? Hire Sencha Services

    Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is in print!

    When posting code, please use BBCode's CODE tags.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts