1. #1
    Sencha User
    Join Date
    Dec 2011
    Posts
    1
    Vote Rating
    0
    Martin_G is on a distinguished road

      0  

    Default Unanswered: How to make offline MVC application?

    Unanswered: How to make offline MVC application?


    I have a MVC application and I have read this articlehttp://www.sencha.com/learn/taking-s...-apps-offline/I do all steps as the article and I found some troublesomeWhen I write my manifest file like that the app can run and it only download thethe "view" "store"" model "and "controller".
    HTML Code:
    CACHE MANIFEST sencha-touch-all.jsexample.csssencha-touch.cssapp.jsNETWORK:app/view/user/card.jsapp/view/user/container.jsapp/view/user/editUser.jsapp/store/user.jsapp/model/user.jsapp/controller/user.js
    However If I want to make my app totally running offline I write another manifest file like that
    HTML Code:
    CACHE MANIFEST sencha-touch-all.jsexample.csssencha-touch.cssapp.jsapp/view/user/card.jsapp/view/user/container.jsapp/view/user/editUser.jsapp/store/user.jsapp/model/user.jsapp/controller/user.js
    The app cannot run successfully.When i open the debug tool in chrome there are something wrong with .js file which are get from the Cache.js.jpgi notice that the normal JS file has the TYPE of "application/x-javascript"but the JS file get from the cache has the TYPE of "undefined" and cannot be used.So i want to know where is the problem with my app.And how to make a totally offline application with MVC in ST2.ThanksMartin

  2. #2
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    37,647
    Vote Rating
    899
    Answers
    3575
    mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute

      0  

    Default


    That tutorial is for ST1 not ST2.

    The way to do this is starting off using Sencha Command to create the app structure (and example files). Then you can build the app into one JS file and it will be saved to localstorage. It will also create a cache manifest file.
    Mitchell Simoens @SenchaMitch
    Sencha Inc, Senior Forum Manager
    ________________
    Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
    https://github.com/mitchellsimoens

    Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/

    Need more help with your app? Hire Sencha Services services@sencha.com

    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.

  3. #3
    Sencha User
    Join Date
    May 2012
    Posts
    7
    Vote Rating
    0
    mrmsol is on a distinguished road

      0  

    Default what about sencha architect.

    what about sencha architect.


    Is there any documentation in how i can do this sencha architect since the folder structure etc is all managed by the UI

  4. #4
    Sencha Premium Member
    Join Date
    Feb 2012
    Location
    North Carolina
    Posts
    308
    Vote Rating
    22
    Answers
    3
    worthlutz will become famous soon enough

      0  

    Default


    Quote Originally Posted by mrmsol View Post
    Is there any documentation in how i can do this sencha architect since the folder structure etc is all managed by the UI
    The way I do it is create the new application directory with the "sencha" command. Then I merge it with my Architect directory. I create the app with Architect and then use "sencha app build..." to build for testing, production...

    This is because the build stuff is not available in Architect on Linux at the moment.

    Some things to watch out for when merging:
    1. The "sencha app create" process puts Main.js in the "app/view" directory. You should replace with your inital view from Architect.
    2. The app.js file from the "sencha app create" process has some code to create a loading indicator for while your app is loading. You will need to add this to your Architect project if you want to use it.
    Once you get the system figured out it works pretty good. I a'm finally moving along after a long learning process. It should get easier as Architect, the SDK tools and all get caught up with each other in development.

    Worth

  5. #5
    Sencha User
    Join Date
    May 2012
    Posts
    7
    Vote Rating
    0
    mrmsol is on a distinguished road

      0  

    Default Thanks for your feedback. I have gone down the path you suggested.

    Thanks for your feedback. I have gone down the path you suggested.


    I think i am getting closer to resolve this. After following through on your instructions now I can see the app is complaining about dispatcher.js and dom.js out of the sencha-touch.js.

    I am using the latest sencha-touch sdk 2.0.1.1.

    could you help me with this?

  6. #6
    Sencha Premium Member
    Join Date
    Feb 2012
    Location
    North Carolina
    Posts
    308
    Vote Rating
    22
    Answers
    3
    worthlutz will become famous soon enough

      0  

    Default


    Quote Originally Posted by mrmsol View Post
    ...now I can see the app is complaining about dispatcher.js and dom.js out of the sencha-touch.js.
    How is it complaining?

    Worth

  7. #7
    Sencha User
    Join Date
    May 2012
    Posts
    7
    Vote Rating
    0
    mrmsol is on a distinguished road

      0  

    Default The files cannot be found

    The files cannot be found


    I have found some threads suggesting I should use
    sencha-touch-debug-all.js instead of sencha-touch.js

    Should I just add that script to my index.html apge to override the sencha-touch.js

    The error I am seeing is coming from sencha-touch.js

  8. #8
    Sencha User
    Join Date
    May 2012
    Posts
    7
    Vote Rating
    0
    mrmsol is on a distinguished road

      0  

    Default just correct me if I am wrong but I think I figured this out

    just correct me if I am wrong but I think I figured this out


    I missed the step where you said
    " .. and then use "sencha app build..." to build for testing, production..."

    I did not build the app yet. I guess that is the problem. I will try that out as soon as i can.