1. #1
    Sencha User Surykat's Avatar
    Join Date
    Jul 2011
    Location
    BIALYSTOK, Poland
    Posts
    58
    Vote Rating
    1
    Surykat is on a distinguished road

      0  

    Default More than one controller class...

    More than one controller class...


    Hi!

    I'm working on kind a big buisness project which i'm developing in Sencha Touch. Now I'm porting project from ST1.0.0. to ST PR2 and I have couple of thoughts..

    I want to have a more than one class controllers. For example, I want to have a controller to each view. I tried to write it and ok - i cut my code into pieces and packed it into controllers. I declared that classes in my app.js file and everything works fine... except a fact that it starts to work impossible SLOW. I need to wait 5-10 seconds to render a one view. I don't know where the problem is or it's mayby a bad programming scenario to cut code into multiple controllers? Having everything in one file (e.g. controller/main.js), which have a over 10000 lines of code is not a good option to work with.

    Could someone tell me what am I doing wrong? Is it a bug or smth that it is working so slow now? Or mayby it is normal that a initialization of every controller make my application to 'think'?

    Thanks for the answers.

  2. #2
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    37,074
    Vote Rating
    854
    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


    Are you loading sencha-touch.js, sencha-touch-all.js, or a built MVC app? If you are using sencha-touch.js then the reason is because it has to load each class needed at startup. This will only happen during development as in production you should use the SDK Tools to build your app and it should have all the needed classes (application and ST2 classes that aren't included in sencha-touch.js)
    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 Surykat's Avatar
    Join Date
    Jul 2011
    Location
    BIALYSTOK, Poland
    Posts
    58
    Vote Rating
    1
    Surykat is on a distinguished road

      0  

    Default


    I'm using sencha-touch-all.js. I have never tried building app using SDK Tools, but I would try it after PR3 where I want to test my app. Now I get back to have all control code in one controller. It's not beautifull in code, but working like a charm.

Thread Participants: 1