1. #1
    Sencha User
    Join Date
    Feb 2010
    Posts
    353
    Vote Rating
    4
    maneljn is on a distinguished road

      0  

    Default best practices combining extjs 4 and sencha touch 2

    best practices combining extjs 4 and sencha touch 2


    which could be the best practices to create a web application with ExtJS desktop and touch for mobile sencha, rewriting the code minimum possible and reusing as much code as possible.

    I want to create an application to be used from desktop computer browser and from smartphone/tablet.
    I know that i have to focus in two ways the usability , but i want to know how to develop smart and reusing as much code possible.

    Manel

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


    Sencha Touch uses the config object everywhere, Ext JS 4 has support but isn't widely used and you will always have to call initConfig in the constructor. MVC is different between the two, controllers can be shared but you won't be able to use the recommended usage. Views will be totally different.
    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
    Feb 2010
    Posts
    353
    Vote Rating
    4
    maneljn is on a distinguished road

      0  

    Default


    can i use ext.direct from both libraries ?

  4. #4
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    36,754
    Vote Rating
    827
    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


    Quote Originally Posted by maneljn View Post
    can i use ext.direct from both libraries ?
    Each has Ext.Direct, there are going to be the same differences as discussed above.
    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.

  5. #5
    Sencha User BulletzBill's Avatar
    Join Date
    Mar 2010
    Location
    New York
    Posts
    138
    Vote Rating
    0
    BulletzBill is on a distinguished road

      0  

    Default


    Wasn't it originally intended for Sencha Touch 2 and ExtJS 4 to share the same core libs for the MVC framework, and will it still eventually be that way, or will there always be the slight differences between the two? From reading the docs and guides on both (touch 2.0 GA and ExtJS 4.1 RC1) it seems that currently still some significant differences, for example within a controller's config in touch you can define a "control" object, whereas the ExtJS 4 analog is to call controller.control() in its init method to bind events.

  6. #6
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    36,754
    Vote Rating
    827
    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

      1  

    Default


    Commonality between the two would be great. My personal opinion is Sencha Touch 2's environment is a lot different than Ext JS 4's so it can do more and differently. Sencha Touch 2 was released a year after Ext JS 4 and it shouldn't be held back. The stuff in Sencha Touch 2 would be large breaking changes in Ext JS 4 that it should then be called Ext JS 5 but there are more important things to fix in Ext JS 4.1 to get in sync with Sencha Touch 2.

    Some day hopefully they will have more common bits but IE6 would not like a lot of things Sencha Touch 2 is doing and Ext JS 4 cannot dump IE6 support.
    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.

  7. #7
    Sencha User
    Join Date
    Apr 2012
    Posts
    2
    Vote Rating
    0
    Romita is on a distinguished road

      0  

    Default


    Hi all, I am brand new on this . I have the same question as the author of this post. Is it possible to reuse some classes between Sencha Touch 2 and Ext JS4? is it not possible?
    This page mentions that Sencha Class System can help to have same classes for Sencha and Ext JS http://www.sencha.com/blog/sencha-learn-roundup/
    You think could be possible to use the same classes for both applications in the model ?(stores, models, and proxy)
    One more question please, is there a tutorial for Sencha to apply mvc as there is one for Ext JS4??
    http://www.sencha.com/learn/the-mvc-...-architecture/

    Best Regards

  8. #8
    Sencha Premium Member
    Join Date
    May 2011
    Posts
    47
    Vote Rating
    0
    bdvr is on a distinguished road

      0  

    Default


    So, Mitchell, do you think this year will be the "some day" you were referring to? I understand that Sencha's policy is to be fairly non-committal, but this is an area where I'd really love to have more insight into Sencha's roadmap. Does Sencha consider the lack of interoperability between the two libraries to be a top priority for the next major release?

    Even if just the data packages were the same, that would go a long way. If controllers and views could be shared as well, or--gasp--there were a "desktop" device profile, I personally would be thrilled.

    Given that jQuery 2.0 is dropping support for IE6, 7, and 8, it doesn't seem unreasonable for ExtJ 5 (or whatever it ends up being called) to do the same.

    So, can we at least get a hint as to the level of attention this issue will receive in the next release? Any insight would be greatly appreciated.

  9. #9
    Ext JS Premium Member itlogo's Avatar
    Join Date
    Mar 2008
    Posts
    37
    Vote Rating
    1
    itlogo is on a distinguished road

      0  

    Default Same questions as above, with some difficulties added in...

    Same questions as above, with some difficulties added in...


    Just adding more fuel to the fire regarding code sharing between ExtJS4 and Touch2. I'm trying to deploy my desktop and mobile-web applications via:

    Code:
    -desktop/
        -mobile/
    So that mobile devices accessing the webapp would be redirected to "desktop/mobile/", and trying to reuse some of the code, such as models and stores. While it works in the web app deployed to my localhost (running unoptimized developer mode), sencha CMD fails to build it. In my mobile app.js, I have

    Code:
    Ext.Loader.setPath({
        'Ext': 'touch/src',
        'MyMobileApp': 'app',
        'MyApp': '../app'
    });
    and this allows the runtime loader to find the "MyApp" codebase. The problem is that during build time for mobile, Sencha CMD goes into ../app (the desktop version) and tries to build that directory structure as well. It finds references to things like "Ext.container.Viewport", and since "Ext" in the mobile framework maps to "touch/src", that class isn't found because that pathname is only relevant for the desktop ExtJS source.

    I might have to resort to symlinking specific directories, i.e. app/store & app/model, from the desktop app down to mobile. Not ideal at all.