1. #1
    Ext JS Premium Member
    Join Date
    May 2008
    Posts
    146
    Vote Rating
    2
    sg707 is on a distinguished road

      0  

    Default ExtJS 4 + Sencha Touch

    ExtJS 4 + Sencha Touch


    Hi Guys,

    In a about a month after ExtJS4 comes out, I will "again" strike for the gold by creating a new Web Application. At that time, I may also consider using Sencha Touch for mobile access as well.

    So!! The question comes to mind on how to modularize the code so that Sencha Touch and ExtJS 4 can be easily be reusable and maintained.

    I'm sure writing 2 complete separate code base would be the "worst" case scenario. The part I'm most puzzled is the ExtJS 4 MVC capability. If ExtJS 4 stays true to MVC philosophy then "Control" and "Model" should be exactly same for Sencha Touch and ExtJS 4. The only extra part would ExtJS 4 View and Sencha Touch View. Am I wrong? I guess to summarize my question would be

    Can I use the same MVC API for ExtJS 4 and Sencha Touch?

    If not, how would you architect a web application that uses both ExtJS 4 and Sencha Touch?

  2. #2
    Sencha - Community Support Team jay@moduscreate.com's Avatar
    Join Date
    Mar 2007
    Location
    Frederick MD, NYC, DC
    Posts
    16,361
    Vote Rating
    81
    jay@moduscreate.com is a name known to all jay@moduscreate.com is a name known to all jay@moduscreate.com is a name known to all jay@moduscreate.com is a name known to all jay@moduscreate.com is a name known to all jay@moduscreate.com is a name known to all

      0  

    Default


    The MVC for Ext 4 will most likely be improved upon.

    That said, the most that can be reused at this point is models and possibly controllers. Views will be different.

  3. #3
    Sencha - Community Support Team Condor's Avatar
    Join Date
    Mar 2007
    Location
    The Netherlands
    Posts
    24,246
    Vote Rating
    94
    Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of

      0  

    Default


    Controllers are only reusable if you make them independent of the view.

    This was one of the things that bothered me about the quick MVC example shown at the conference. The controller contained event handlers from components in the view. These events should be generalized and not be directly fired from the components.

  4. #4
    Sencha - Community Support Team jay@moduscreate.com's Avatar
    Join Date
    Mar 2007
    Location
    Frederick MD, NYC, DC
    Posts
    16,361
    Vote Rating
    81
    jay@moduscreate.com is a name known to all jay@moduscreate.com is a name known to all jay@moduscreate.com is a name known to all jay@moduscreate.com is a name known to all jay@moduscreate.com is a name known to all jay@moduscreate.com is a name known to all

      0  

    Default


    Quote Originally Posted by Condor View Post
    Controllers are only reusable if you make them independent of the view.

    This was one of the things that bothered me about the quick MVC example shown at the conference. The controller contained event handlers from components in the view. These events should be generalized and not be directly fired from the components.
    Agreed. The only problem with that is you add overhead to dispatch to a controller for every event you want fired, adding more to the method stack.

  5. #5
    Ext JS Premium Member
    Join Date
    May 2008
    Posts
    146
    Vote Rating
    2
    sg707 is on a distinguished road

      0  

    Default


    Thanks for the response!

    I really can't wait to see the MVC stuff..wasn't able to find that demo through the conference videos. I'm not too surprise that Controller has direct tied to specific View classes at this point. It's probably missing the "configuration" layer which makes the Controller and View layer independent... ah well.. Maybe later version will improve upon on this.

  6. #6
    Sencha User
    Join Date
    Sep 2013
    Posts
    2
    Vote Rating
    0
    agamil is on a distinguished road

      0  

    Default


    I haven't really used Sencha much at all yet except for playing around a little with the trial of architect and trying Sencha Touch.

    But what if you configure the controlQuery of the controller event so that it refers to something of the exact same name of the component in the other view type?

    So, for example, we have one controller for both ExtJs and Sencha Touch that has ControllerAction with a controlQuery of "myFormPanel button" and then in the two views, we make sure that the view and button names or whatever are the same.

Similar Threads

  1. How to covert a working ExtJS datastore to Sencha Touch model?
    By locutusUT in forum Sencha Touch 1.x: Discussion
    Replies: 3
    Last Post: 29 Sep 2011, 11:05 PM
  2. ExtJS 4 and Sencha Touch API resemblance
    By gevik in forum Community Discussion
    Replies: 1
    Last Post: 19 Dec 2010, 12:45 AM
  3. Sencha Touch + ExtJs component ?
    By liquidsnake in forum Sencha Touch 1.x: Discussion
    Replies: 2
    Last Post: 25 Oct 2010, 5:52 PM
  4. Rendering Sencha Touch Mobile App within ExtJS 3.2.1 Environment
    By yuhimfresh in forum Ext 3.x: Help & Discussion
    Replies: 1
    Last Post: 25 Oct 2010, 4:59 PM

Thread Participants: 3