MVC IN SENCHA TOUCH
By,Amith
Why MVC?
What’s MVC?
Small Talk 80 introduces MVC
Model View Controller
Model
Loads and manages the application data
Usually in response to request from the View
View
Manages the display of information and UI controls
Controller
Listens for input from the user , updates Model and View
Model
Table
+Insert()
+update()
+delete()
View
Controller
Model
Ext.define(‘MyApp.model.User’,{extend:’ext.data.model’,
fields:[‘name’,‘email’,‘password’
]});
View
Ext.define(‘MyApp.view.Info’,{extend:’Ext.Panel’,config:{
html:’this is such a good example’}
});
Controller
Ext.define(‘MyApp.controller.Users’,{
extend:’ext.app.Controller’,
init:function(){
this.control({
‘button’:{
tap:function(){
alert(“you have tapped a button”);
}
}
});
},
});
File Structure
Live Code*
*Might end in a disaster..!!!
Questions…?
Thank you..!