28 Jan 2011 2:34 PM #1
ExtJS 4 + Sencha Touch
ExtJS 4 + Sencha Touch
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?
1 Feb 2011 4:55 AM #2
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.
1 Feb 2011 5:08 AM #3
- Join Date
- Mar 2007
- The Netherlands
- Vote Rating
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.
1 Feb 2011 5:13 AM #4
2 Feb 2011 9:58 AM #5
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.
4 Oct 2013 6:02 AM #6
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.
By locutusUT in forum Sencha Touch 1.x: DiscussionReplies: 3Last Post: 29 Sep 2011, 11:05 PM
By gevik in forum Community DiscussionReplies: 1Last Post: 19 Dec 2010, 12:45 AM
By liquidsnake in forum Sencha Touch 1.x: DiscussionReplies: 2Last Post: 25 Oct 2010, 5:52 PM
By yuhimfresh in forum Ext 3.x: Help & DiscussionReplies: 1Last Post: 25 Oct 2010, 4:59 PM